Convert any BST into doubly linked list in place
Page 1 of 1
Convert any BST into doubly linked list in place
public LinkedListNode convert(Node root, LinkedListNode head){
if(root==null)
return head;
convert(root.left, head);
LinkedListNode temp=new LinkedListNode(root);
head.next=temp;
temp.previous=head;
temp.next=null;
convert(root.right,head);
}
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|