0% found this document useful (0 votes)
7 views1 page

Understanding Binary Search Trees

BST terminology defines nodes, parents, children, subtrees, siblings, leaves, degree of nodes, degree of trees, and levels. Tree travel can be preorder visiting the parent first then left and right, inorder visiting left then parent then right, or postorder visiting left then right then parent. BST keys must be unique with smaller values going left and bigger values going right.

Uploaded by

charlysu
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views1 page

Understanding Binary Search Trees

BST terminology defines nodes, parents, children, subtrees, siblings, leaves, degree of nodes, degree of trees, and levels. Tree travel can be preorder visiting the parent first then left and right, inorder visiting left then parent then right, or postorder visiting left then right then parent. BST keys must be unique with smaller values going left and bigger values going right.

Uploaded by

charlysu
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

BST

Terminology
node
praent
child
sub tree
sibling
leaf
degree of node
degree of tree
level
Tree travel
for every subtree,
accrdoing to when you visit the parent node,
3 rules are possible(left is priority) :
- preorder
prent(1st visited) -> left -> right
- inorder
left -> parent(2nd visited) -> right
- postorder
left -> right -> parent(3rd visited)
BST
Q: does every key has to be unique?
movement :
smaller goes to left
bigger goes to right

You might also like