Using System; The public class LinkedList {//nested class represents a single node; Private class Node {public node (object values) {item=values;} public Object it Em Data fields, public linkedlist.node next;//pointer fields, public override string ToString () {return item. ToString (); A private int count;//the number of record elements; public int count {get {return this.count;}} private Node head;//header pointer; public object [int index]//indexer; {get {return Getbyindex (index). Item;} set{getbyindex (Index). Item=value}}//① add element; public void Add ( Object values) {node newnode=new node (values); if (head ==null)//If the header pointer is empty; {Heads =newnode} else {Getbyindex (count-1 ). Next=newnode; Plug into the end of the list;} count + +; List length +1;//② inserts an element at the specified index; public void Insert (int index,object values) {Node tempnode; if (index ==0) {if (head ==null) { Tempnode =new Node (values); Tempnode.next =head; Head =tempnode; } else {node prenode=getbyindex (index-1);//Find the predecessor of the insertion node, node Nextnode=prenode.next;//Find the successor node of the insertion point; Tempnode =new node (VA Lues); Prenode.next =tempnode; TempnodE.next =nextnode; Count + +; //③ deletes the specified index element; the public void RemoveAt (int index) {if (index ==0)//Delete node is the head pointer; {heads =head.next;} else {node Prenode=getb Yindex (index-1); if (Prenode.next ==null) {throw new ArgumentOutOfRangeException ("index"), the index is out of range. "); } Prenode.next =prenode.next.next; Count--; public override string ToString () {string s= ' "; for (Node temp=head; temp!=null; temp=temp.next) {s+=temp. ToString () + "";} return s; Private Node getbyindex (int index) {if ((index <0) | | (index >= This.count)) {throw new ArgumentOutOfRangeException (' index ', ' index is out of range. "); } Node Tempnode=this.head; for (int i=0;i<index; i++) {tempnode=tempnode.next;} return tempnode; } class App {static void Main () {LinkedList lst=new linkedlist (); Console. WriteLine ("① add element:"); Lst. ADD (0); Lst. ADD (1); Lst. ADD (2); Lst. ADD (3); Console. WriteLine (LST. ToString ()); Console. WriteLine ("② in position 2nd, add Element 50:"); Lst. Insert (2,50); Console. WriteLine (LST. ToString ()); Console. WriteLine ("③ Remove number 1thelement: "); Lst. RemoveAt (1); Console. WriteLine (LST. ToString ()); Console. WriteLine ("④ 2nd number of elements assigned to 9:"); LST [2]=9; Console. WriteLine (LST. ToString ()); } }