Mapa mental
Binary Trees
Conteúdo do mapa
Binary Trees
Root (first node)
- Can have repeating elements.
- Can be structured or not
- Leaves (nodes without children)
- Can have one or two children
Example (Binary Search Tree): Organized
- Root
- Left children
- Root > Left
- left child 1
- left child 2
- Right Children
- Root < Right
- right child 1
- right child 2
- Value principle applies to subtrees also
- Elements on the left side will always be less than the root.
- Elements on the right side will always be greater than the root and the left side.
- Inserting and searching elements follow the same pattern of recursively comparing the target element to whether that element is greater than or less than the left or right children.
- Happens recursively in python.
- Inserting and searching elements follow the same pattern of recursively comparing the target element to whether that element is greater than or less than the left or right children.
- Elements on the right side will always be greater than the root and the left side.
- Elements on the left side will always be less than the root.
- Left children
- Dictated by ordered relationships
- Current element
- Greater than
- Less than
- Current element
- Root
Informações
- Descrição
- Mapa Mental sobre Binary Trees, criado por Phuc Pham em 23-10-2021.
- Criado por
- Phuc Pham
- Visualizações
- 0
- Avaliação