コード例 #1
0
        public static Node2 insert(Node2 head, int data)
        {
            Node2 p = new Node2(data);


            if (head == null)
            {
                head = p;
            }
            else if (head.next == null)
            {
                head.next = p;
            }
            else
            {
                Node2 start = head;
                while (start.next != null)
                {
                    start = start.next;
                }
                start.next = p;
            }
            return(head);
        }
コード例 #2
0
 public static Node2 removeDuplicates(Node2 head)
 {
     //Write your code here
 }
コード例 #3
0
 public Node2(int d)
 {
     data = d;
     next = null;
 }