Workshop 7 - Binary Trees Flashcards
Hierarchral data
Unique presdessor and many sucessors.
Binary Search tree
every node is of degrees two or less.
key in left subtree of the root preceeds the key in the root.
key in root node precedes the keys in right tree.
left and right subtrees of the root are also BST.
BST Deletion
Three cases:
Case 1 - The node is a leaf node
Case 2 - The node has one subtree.
Case 3 - The node has two subtrees.
depth first traersal info
stack is used..
proceeedd along a path from root through one child to most distant descendant of the first child before processsing the second child.
PreOrder,InOrder,PostOrder
leaf by leaf
breadth first travesel info
Queue is used.
proceeds horizontally from root of all its children then to its children.
uses a queue.
level by level.
depth first traersal
V - Visit node
L - Traverse the Left subtree.
R - Traverse the Right subtree.
Three used:
VLR - PreOrder Traversal
LVR - InOrder Traversal
LRV - PostOrder Traversal
breadth first travesel