Project: 0x1D. C - Binary trees

Resources

Read or watch:

Learning Objectives

General

  • What is a binary tree
  • What is the difference between a binary tree and a Binary Search Tree
  • What is the possible gain in terms of time complexity compared to linked lists
  • What are the depth, the height, the size of a binary tree
  • What are the different traversal methods to go through a binary tree
  • What is a complete, a full, a perfect, a balanced binary tree

Tasks

Task File
0. New node 0-binary_tree_node.c
1. Insert left 1-binary_tree_insert_left.c
2. Insert right 2-binary_tree_insert_right.c
3. Delete 3-binary_tree_delete.c
4. Is leaf 4-binary_tree_is_leaf.c
5. Is root 5-binary_tree_is_root.c
6. Pre-order traversal 6-binary_tree_preorder.c
7. In-order traversal 7-binary_tree_inorder.c
8. Post-order traversal 8-binary_tree_postorder.c
9. Height 9-binary_tree_height.c
10. Depth 10-binary_tree_depth.c
11. Size 11-binary_tree_size.c
12. Leaves 12-binary_tree_leaves.c
13. Nodes 13-binary_tree_nodes.c
14. Balance factor 14-binary_tree_balance.c
15. Is full 15-binary_tree_is_full.c
16. Is perfect 16-binary_tree_is_perfect.c
17. Sibling 17-binary_tree_sibling.c
18. Uncle 18-binary_tree_uncle.c
19. Lowest common ancestor 100-binary_trees_ancestor.c
20. Level-order traversal 101-binary_tree_levelorder.c
21. Is complete 102-binary_tree_is_complete.c
22. Rotate left 103-binary_tree_rotate_left.c
23. Rotate right 104-binary_tree_rotate_right.c
24. Is BST 110-binary_tree_is_bst.c
25. BST - Insert 111-bst_insert.c 0-binary_tree_node.c
26. BST - Array to BST 112-array_to_bst.c, 111-bst_insert.c, 0-binary_tree_node.c
27. BST - Search 113-bst_search.c
28. BST - Remove 114-bst_remove.c
29. Big O #BST 115-O
30. Is AVL 120-binary_tree_is_avl.c
31. AVL - Insert 121-avl_insert.c, 14-binary_tree_balance.c, 103-binary_tree_rotate_left.c, 104-binary_tree_rotate_right.c, 0-binary_tree_node.c
32. AVL - Array to AVL 122-array_to_avl.c, 121-avl_insert.c, 0-binary_tree_node.c, 103-binary_tree_rotate_left.c, 104-binary_tree_rotate_right.c, 14-binary_tree_balance.c
33. AVL - Remove 123-avl_remove.c, 14-binary_tree_balance.c, 103-binary_tree_rotate_left.c, 104-binary_tree_rotate_right.c
34. AVL - From sorted array 124-sorted_array_to_avl.c, 0-binary_tree_node.c
35. Big O #AVL Tree 125-O
36. Is Binary heap 130-binary_tree_is_heap.c
37. Heap - Insert 131-heap_insert.c, 0-binary_tree_node.c
38. Heap - Array to Binary Heap 132-array_to_heap.c, 131-heap_insert.c, 0-binary_tree_node.c
39. Heap - Extract 133-heap_extract.c
40. Heap - Sort 134-heap_to_sorted_array.c, 133-heap_extract.c
41. Big O #Binary Heap 135-O