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

binary tree: boundary traversal #94

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Shekharrajak
Copy link

Feature added :
boundary Traversal ( root node -> left subtree boundary nodes -> leaf nodes -> right subtree boundary nodes)

>>> from pydsa.binary_tree import BTNode
>>> bt = BTNode(1)
>>> bt.insert("left", 2)
>>> bt.insert("right", 3)
>>> bt.right.insert("left", 6)
>>> bt.right.insert("right", 7)
>>> bt.left.insert("left", 4)
>>> bt.left.insert("right", 5)
>>> bt.left.left.insert("left", 8)
>>> bt.left.left.insert("right", 9)
>>> bt.boundaryTrav(bt)
>>> [1, 2, 4, 8, 9, 5, 6, 7, 3]

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

Successfully merging this pull request may close these issues.

None yet

1 participant