give me an answer
来源:学生作业帮 编辑:大师作文网作业帮 分类:综合作业 时间:2024/11/10 19:41:56
give me an answer
class Program
{
static void Main(string[] args)
{
LinkedList list = new LinkedList();
list.AddFirst(10);
list.AddLast(20);
list.AddLast(30);
list.AddLast(40);
The above program is incomplete,please complete the above program to perform following operations on linked list,the operations to be performed are:
i.Display total number of nodes into the linked list
ii.Add value :25 after 20.
iii.Add value 5 before 10
iv.Check that the list contains value 30,if contains display a message “30 is into the linked list”
v.Display the values of all the nodes from the linked list.
class Program
{
static void Main(string[] args)
{
LinkedList list = new LinkedList();
list.AddFirst(10);
list.AddLast(20);
list.AddLast(30);
list.AddLast(40);
The above program is incomplete,please complete the above program to perform following operations on linked list,the operations to be performed are:
i.Display total number of nodes into the linked list
ii.Add value :25 after 20.
iii.Add value 5 before 10
iv.Check that the list contains value 30,if contains display a message “30 is into the linked list”
v.Display the values of all the nodes from the linked list.
using System;
using System.Collections.Generic;
using System.Text;
namespace LinkedListDemo
{
class Program
{
static void Main(string[] args)
{
LinkedList<int> list = new LinkedList<int>();
list.AddFirst(10);
list.AddLast(20);
list.AddLast(30);
list.AddLast(40);
//i. Display total number of nodes into the linked list
Console.WriteLine("Total number of nodes:{0}", list.Count);
//ii. Add value : 25 after 20.
list.AddAfter(list.Find(20), 25);
//iii. Add value 5 before 10
list.AddBefore(list.Find(10), 5);
//iv. Check that the list contains value 30, if contains display a message “30 is into the linked list”
if (list.Contains(30)) {
Console.WriteLine("30 is into the linked list");
}
//v. Display the values of all the nodes from the linked list.
foreach (int value in list) {
Console.Write("{0} ", value);
}
Console.ReadKey();
}
}
}
using System.Collections.Generic;
using System.Text;
namespace LinkedListDemo
{
class Program
{
static void Main(string[] args)
{
LinkedList<int> list = new LinkedList<int>();
list.AddFirst(10);
list.AddLast(20);
list.AddLast(30);
list.AddLast(40);
//i. Display total number of nodes into the linked list
Console.WriteLine("Total number of nodes:{0}", list.Count);
//ii. Add value : 25 after 20.
list.AddAfter(list.Find(20), 25);
//iii. Add value 5 before 10
list.AddBefore(list.Find(10), 5);
//iv. Check that the list contains value 30, if contains display a message “30 is into the linked list”
if (list.Contains(30)) {
Console.WriteLine("30 is into the linked list");
}
//v. Display the values of all the nodes from the linked list.
foreach (int value in list) {
Console.Write("{0} ", value);
}
Console.ReadKey();
}
}
}
give me an answer
Give me an answer,please!
give me the answer 还是give me an answer
Give me an answer let me
i give you my chance chance you give me an answer answer是什么歌
Ask an English question,please give me the correct answer.
What things only can computer do give me an answer.
give me this answer please
please give me your answer
i want all of you ----this and give me an answer.
帮忙翻译成中文 Give me an answer,my letter asks.In any way you chos
Give me an