Tree structure allows extensive use of recursion for performing various operations. This property of trees is exploited for converting a given BST into a circular doubly linked list.
Algorithm:
- Convert left subtree of the tree into a circular doubly linked list.
- Convert right subtree of the tree into a circular doubly linked list.
- Append root to the list of left subtree.
- Append the list of right subtree to the root.
Thanks It was very Helpful
ReplyDelete