From 5c4bb344e9d23c8f5943160108f5f8730656edc0 Mon Sep 17 00:00:00 2001 From: lshprung Date: Tue, 2 Mar 2021 10:12:11 -0800 Subject: Post-class 03/02 --- 02-25.md | 40 +--------------------------------------- 1 file changed, 1 insertion(+), 39 deletions(-) (limited to '02-25.md') diff --git a/02-25.md b/02-25.md index e5be2fe..b4411b8 100644 --- a/02-25.md +++ b/02-25.md @@ -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) -- cgit