Skip to content

Add Dart solution for Binary Tree Inorder Traversal - #556

Open
rrbharath wants to merge 1 commit into
codedecks-in:masterfrom
rrbharath:binary-tree-inorder-traversal-dart
Open

Add Dart solution for Binary Tree Inorder Traversal#556
rrbharath wants to merge 1 commit into
codedecks-in:masterfrom
rrbharath:binary-tree-inorder-traversal-dart

Conversation

@rrbharath

Copy link
Copy Markdown
Contributor

Description

Adds a Dart solution for Binary Tree Inorder Traversal.

The approach uses recursion to visit the left subtree first, then the current node, then the right subtree.

Dependencies: None.

Time Complexity: O(n)
Space Complexity: O(n), due to recursion stack in the worst case
Difficulty: Easy
Tags: Stack, Tree, Depth-First Search, Binary Tree

Put check marks:

Have you made changes in README file ?

  • Added problem & solution under correct topic.
  • Specified Space & Time complexity.
  • Specified difficulty level, tag & Note(if any).

README was not changed in this branch.

How Has This Been Tested?

The solution was reviewed against the expected LeetCode Dart method signature and common sample cases.

  • Verified traversal order is left, root, right
  • Verified null root returns an empty list

Make sure all below guidelines are followed else PR will get Reject:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code so that it is easy to understand
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant