Learning Objectivesđź’ˇ What you should learn from this project:
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 Data structures Basic Binary Tree /**
- struct binary_tree_s - Binary tree node
- @n: Integer stored in the node
- @parent: Pointer to the parent node
- @left: Pointer to the left child node
- @right: Pointer to the right child node */ struct binary_tree_s { int n; struct binary_tree_s *parent; struct binary_tree_s *left; struct binary_tree_s *right; };
typedef struct binary_tree_s binary_tree_t; Binary Search Tree typedef struct binary_tree_s bst_t; AVL Tree typedef struct binary_tree_s avl_t; Max Binary Heap typedef struct binary_tree_s heap_t; 0. New node Write a function that creates a binary tree node
-
Insert left Write a function that inserts a node as the left-child of another node
-
Insert right All your files, classes, functions must be tested with unit tests
-
Delete Write a function that deletes an entire binary tree
-
Is leaf Write a function that checks if a node is a leaf
-
Is root Write a function that checks if a given node is a root
-
Pre-order traversal Write a function that goes through a binary tree using pre-order traversal
-
In-order traversal Write a function that goes through a binary tree using in-order traversal
-
Post-order traversal Write a function that goes through a binary tree using post-order traversal
-
Height Write a function that measures the height of a binary tree
-
Depth Write a function that measures the depth of a node in a binary tree
-
Size Write a function that measures the size of a binary tree
-
Leaves Write a function that counts the leaves in a binary tree
-
Nodes Write a function that counts the nodes with at least 1 child in a binary tree
-
Balance factor Write a function that measures the balance factor of a binary tree
-
Is full Write a function that checks if a binary tree is full
-
Is perfect Write a function that checks if a binary tree is perfect
-
Sibling Write a function that finds the sibling of a node
-
Uncle Write a function that finds the uncle of a node
-
Lowest common ancestor Write a function that finds the lowest common ancestor of two nodes
-
Level-order traversal Write a function that goes through a binary tree using level-order traversal
-
Is complete Write a function that checks if a binary tree is complete
-
Rotate left Write a function that performs a left-rotation on a binary tree
-
Rotate right Write a function that performs a right-rotation on a binary tree
-
Is BST Write a function that checks if a binary tree is a valid Binary Search Tree
-
BST - Insert Write a function that inserts a value in a Binary Search Tree
-
BST - Array to BST Write a function that builds a Binary Search Tree from an array
-
BST - Search Write a function that searches for a value in a Binary Search Tree
-
Big O #BST Average time complexities of insert, delete, search for BST