package
Version:
v1.4.6
Opens a new window with list of versions in this module.
Published: Sep 14, 2019
License: MIT
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
< Previous
Next >
114. Flatten Binary Tree to Linked List (Medium)
Given a binary tree, flatten it to a linked list in-place.
For example, given the following tree:
1
/ \
2 5
/ \ \
3 4 6
The flattened tree should look like:
1
\
2
\
3
\
4
\
5
\
6
[Tree]
[Depth-first Search]
Similar Questions
- Flatten a Multilevel Doubly Linked List (Medium)
Hints
Hint 1
If you notice carefully in the flattened tree, each node's right child points to the next node of a pre-order traversal.
Documentation
¶
There is no documentation for this package.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.