1.

Consider the following doubly linked list: head-1-2-3-4-5-tail
What will be the list after performing the given sequence of operations?

	Node temp = new Node(6,head,head.getNext());
	head.setNext(temp);
	temp.getNext().setPrev(temp);
	Node temp1 = tail.getPrev();
	tail.setPrev(temp1.getPrev());
	temp1.getPrev().setNext(tail);

A. head-6-1-2-3-4-5-tail
B. head-6-1-2-3-4-tail
C. head-1-2-3-4-5-6-tail
D. head-1-2-3-4-5-tail
Answer» C. head-1-2-3-4-5-6-tail


Discussion

No Comment Found