From 93b3587bcaee025c02c1987083dd129e3cd56b5d Mon Sep 17 00:00:00 2001 From: bt3gl <138340846+cypher-bt3gl@users.noreply.github.com> Date: Sat, 29 Jul 2023 20:48:55 -0700 Subject: [PATCH] Update README.md --- trees_and_graphs/README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/trees_and_graphs/README.md b/trees_and_graphs/README.md index 262392f..dc1861d 100644 --- a/trees_and_graphs/README.md +++ b/trees_and_graphs/README.md @@ -2,6 +2,20 @@
+### trees + +
+ +* a node is called **leaf** if has no children. +* **binary trees**: each node has up to 2 children. +* **binary search tree**: all nodes on the left are smaller than the root, which is smaller than all nodes on the right. + * if the bst is **balanced**, it guarantees O(log(n)) for insert and search. +* common types of balanced trees: **red-black** and **avl**. +* a **complete tree** is a tree on which every level is fully filled (except perhaps for the last). +* a **full binary tree** has each node with either zero or two children (and no node has only one child). +* a **perfect tree** is both full and complete (it must have exactly 2**k - 1 nodes, where k is the number of levels). + +
---