Given the linked chain below:

3 nodes with 2,4,16 in them

which is the resulting linked chain after the execution of:

            Node newNode = new Node();
            newNode.data = 8;
            curr = head;
            while (curr.next.data < 8) {
              curr = curr.next;
            }
            newNode.next = curr.next;
            curr.next = newNode;
              
          



A) 3 nodes with 2,4,8 and head pointing to the node storing 8
B) 4 nodes with 5,27,13, 81 and head pointing to the node storing 81
C) 3 nodes with 2,4,8 and head pointing to the node storing 2>
D) 4 nodes with 2,4,8, 16 and head pointing to the node storing 2

D
  • A
  • C
  • B

There are no hints for this question