
Learn live coding of binary search trees in C, covering insertion, in-order traversal, and deletion, with real-world context on AVL and red black trees.
Locate the in-order successor of the node to delete and adjust the successor's parent by splicing the right child. Copy the successor's data into the node and free the successor.
In this course we will do live coding of Binary Search Tree in C language. While coding, I am also sharing the thought process which goes on while implementing the logic. We will face compile-time, run-time errors and then we will resolve them.
Binary Search Tree is one of the fundamental data structures used in software development. Many variants of BST like AVL tree, Red-Black tree are used in real world applications. For e.g. "map" container in C++ STL library uses Red-Black tree, Linux Kernel uses Red-Black tree for process scheduling.
In this course we will do hands-on coding of various operations which can be done on BST like:
Writing node structure for BST containing (integer data, pointers to left and right child)
inserting and element into Binary Search Tree - I will explain the property of the Binary Search Tree. With the help of an example (sequence of elements) we will construct the BST.
Displaying the elements of the Binary Search Tree (inorder traversal - theory explanation and then hands on coding)
Deleting elements from the Binary Search Tree 3 cases:
Leaf node
Node with 1 child
Node with 2 children
Passing data by reference and accepting arguments through pointer variables
Different C concepts used while coding:
malloc(), sizeof(), free(), typedef, structures, linked lists, gcc compiler, VS Code editor.