Day-5 Flashcards
Tree
Any connections of nodes with children. We have root on the top and leaf at the bottom.
Binary Tree
It’s a tree that doesn’t conform to the BST pattern so it has zero up-to 2 children. The order of the children doesn’t matter here as long as we are not searching (leave that for BST).
Binary Search Tree (BST)
https://www.icloud.com/keynote/0HsxTSLp6ajYiE8VSwsR5oyUA#Binary_Search_Trees
A binary tree where every node has two children. We compare a value to the current node. Less than current node’s value goes to the left of the tree, otherwise goes to the right.
Nodes without children is considered leafs.
A leaf doesn’t have children.
Edges are the connections between nodes.
Depth of a node is the number of edges/connections from then root to the node.
The height of a node is the number of connections from the node to its deepest leaf.
O(log) can be explained on Trees awesomely
Its always one step when we double our value. From 1 to 2 is one step , from 2 to 4 is one step , from 4 to 8 is one step …..