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);
}
Similar topics
» Find if a singly linked List has loop or not. How to find out middle element from a looped single linked list
» Combine two sorted linked list
» Revert a linked list with a cycle in it. (Thus removing the cycle)
» convert a string into integer
» Insert in front of the list
» Combine two sorted linked list
» Revert a linked list with a cycle in it. (Thus removing the cycle)
» convert a string into integer
» Insert in front of the list
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|