VOOZH about

URL: https://www.geeksforgeeks.org/videos/problem-of-the-day-17112023-binary-tree-to-cdll/

⇱ PROBLEM OF THE DAY : 17/11/2023 | Binary Tree to CDLL - GeeksforGeeks | Videos


November 18, 2023 |720 Views

PROBLEM OF THE DAY : 17/11/2023 | Binary Tree to CDLL

Description
Discussion

Welcome to the daily solving of our PROBLEM OF THE DAY with Karan Mashru. We will discuss the entire problem step-by-step and work towards developing an optimized solution. This will not only help you brush up on your concepts of String but also build up problem-solving skills.

In this problem, we are given, a Binary Tree of N edges. The task is to convert this to a Circular Doubly Linked List (CDLL) in-place. The left and right pointers in nodes are to be used as previous and next pointers respectively in CDLL. The order of nodes in CDLL must be same as Inorder of the given Binary Tree. The first node of Inorder traversal (left most node in BT) must be head node of the CDLL.



Input:
     1
   /   \
  3     2
Output:
3 1 2 
2 1 3

After converting tree to CDLL when CDLL is is traversed from head to tail and then tail to head, elements are displayed as in the output.

Give the problem a try before going through the video. All the best!!!
Problem Link:
Solution Link:  

Recommendations
2.0K Views | 23/04/2026...
Row with maximum number of 1s
5.8K Views | 10/01/2025...
Rotate a Linked List
5.9K Views | 15/11/2024...
PROBLEM OF THE DAY : 14/11/2024 | Nearly Sorted
860 Views | 14/11/2024...
PROBLEM OF THE DAY : 13/11/2024 | Intersection Point in Y Shaped Linked Lists
910 Views | 13/11/2024...
PROBLEM OF THE DAY : 04/11/2024 | Find All Triplets with Zero Sum
800 Views | 13/11/2024...
PROBLEM OF THE DAY : 12/11/2024 | Meeting Rooms
530 Views | 12/11/2024...
PROBLEM OF THE DAY : 11/11/2024 | Make Array Elements Unique
490 Views | 11/11/2024...
PROBLEM OF THE DAY : 09/11/2024 | Minimum Sum
250 Views | 11/11/2024...
PROBLEM OF THE DAY : 10/11/2024 | Union of Two Sorted Arrays with Distinct Elements
500 Views | 09/11/2024...
PROBLEM OF THE DAY : 08/11/2024 | Minimum Repeat to Make Substring