diff options
author | lshprung <lshprung@yahoo.com> | 2021-03-02 10:12:11 -0800 |
---|---|---|
committer | lshprung <lshprung@yahoo.com> | 2021-03-02 10:12:11 -0800 |
commit | 5c4bb344e9d23c8f5943160108f5f8730656edc0 (patch) | |
tree | 943693a22b2365c58e651f25deb57f2fd6463061 /02-25.md | |
parent | 8c8e9010ba73baa4631eefe6ee78f915e94184d4 (diff) |
Post-class 03/02
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) |