• Tutorials
  • DSA
  • Data Science
  • Web Tech
  • Courses
August 21, 2024 |2.2K Views

Convert a given Binary Tree to a Doubly Linked List

  Share  1 Like
Description
Discussion

In this video, we are given a binary tree. The task is to in-place convert the binary tree into a doubly linked list. 

For Example: 
Input:
      10
     /   \
    20   30
  /   \
 40   60

Output:
40 20 60 10 30 
30 10 60 20 40

Explanation:  DLL would be 
40<=>20<=>60<=>10<=>30.

Try it out before watching the implementation of the problem in the video. We recommend watching the video, even if you can solve the problem. You may discover something new. All the best!!!

Do check out:-

Article: https://www.geeksforgeeks.org/convert-binary-tree-to-doubly-linked-list-using-inorder-traversal/
Problem: https://practice.geeksforgeeks.org/problems/binary-tree-to-dll/1
SDE Sheet: https://www.geeksforgeeks.org/sde-sheet-a-complete-guide-for-sde-preparation/