Skip to content
This repository has been archived by the owner on May 29, 2024. It is now read-only.

Flatten a binary tree to Linked List in CPP #965

Open
1 of 2 tasks
JIsaacSamuel opened this issue Oct 6, 2022 · 4 comments
Open
1 of 2 tasks

Flatten a binary tree to Linked List in CPP #965

JIsaacSamuel opened this issue Oct 6, 2022 · 4 comments
Assignees
Labels
C++ language used is C++

Comments

@JIsaacSamuel
Copy link

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

  • Yes
  • No

Other context

An interview question.

@welcome
Copy link

welcome bot commented Oct 6, 2022

Thanks for opening your first issue here! Be sure to follow the issue template!

@JIsaacSamuel JIsaacSamuel changed the title Flatten a binary tree to Linked List in CPP #898 Flatten a binary tree to Linked List in CPP Oct 6, 2022
@JIsaacSamuel
Copy link
Author

hey @ming-tsai, I would love to work on this issue. Do add hacktoberfest label. Thanks in advance.

@ming-tsai ming-tsai added the C++ language used is C++ label Oct 6, 2022
@ming-tsai
Copy link
Member

hey @ming-tsai, I would love to work on this issue. Do add hacktoberfest label. Thanks in advance.

Please read the issue #968

@Mudit-Jxin7
Copy link

Hi I would like to contribute to this issue if anyone else is not working on it

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C++ language used is C++
Projects
None yet
Development

No branches or pull requests

3 participants