You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 29, 2024. It is now read-only.
We are given a root of the binary tree, and the given binary tree needs to be flattened into a linked list:
Here are the rules which are followed while converting it into a linked list:
The "linked list" should use the same TreeNode class where the right child pointer points to the next node in the list and the left child pointer is always null.
The "linked list" should be in the same order as a [pre-order traversal] of the binary tree.
Information about Algorithm
We are given a root of the binary tree, and the given binary tree needs to be flattened into a linked list:
Here are the rules which are followed while converting it into a linked list:
The "linked list" should use the same TreeNode class where the right child pointer points to the next node in the list and the left child pointer is always null.
The "linked list" should be in the same order as a [pre-order traversal] of the binary tree.
Have you read the Contributing.md and Code of conduct
Other context
An interview question.
The text was updated successfully, but these errors were encountered: