diff options
Diffstat (limited to '02-25.md')
-rw-r--r-- | 02-25.md | 40 |
1 files changed, 1 insertions, 39 deletions
@@ -367,42 +367,4 @@ That is not a palindrome. --- -# Intro to Tree - -- In computer science, trees are upside down, with the root at the top -- Has nodes, and branches - -## Tree vs Graph - -- Graph may be circular, doesn't necessarily have directions -- A tree is a graph, but a graph is not a tree - - Graph is the general form of the tree - -## Binary Tree - -- Maximum of 2 branches -- Parents and children - - Ancestors and descendents -- A tree can have subtrees - - Any branch that you cut gives you a subtree - - Structurally, a subtree is a tree - -- Recursion is widely used on tree operations - -### Complete Binary Tree - -- All nodes are filled from left to right - -### Full Binary Tree - -- Every child node needs to be NULL or have 2 children -- Number of nodes is going to be `2^n` where `n` is the height of the tree - -### Data Structure - -- A binary tree node has three member variables - - `data_type value` - - `tree_node *left` - - `tree_node *right` - -- Need setters and getters +[03/02 ->](03-02.md) |