Leetcode 114 | Flatten Binary Tree to Linked List (Java Solution with detailed Explanation)

preview_player
Показать описание
Flatten Binary Tree to Linked List is a leetcode problem commonly asked in coding interview for amazon, google, microsoft, vmware etc.

Problem statement:

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

Рекомендации по теме
Комментарии
Автор

Good job, can you explain why it 0ms execution time.
If copied same solution it give random 80ms 120ms 116 ms

abhinaygupta
Автор

can you explain what flatten(root.left) specifically does? im confused about its purpose

hershey
welcome to shbcf.ru