MOTILAL NEHRU NATIONAL INSTITUTE OF TECHNOLOGY
Data Structures and Operating Systems Lab
Lab Assignment 8
1. Implement a binary tree, supporting the following operations:
a) Insert(): Insert a node into the tree.
b) Display(): Display the tree using in-order traversal.
2. Implement a binary search tree (BST) with the following operations:
a) Insert(): Insert a node in the BST.
b) Search(): Search for a given element in the BST and return whether it exists.
c) Delete(): Delete a node from the BST.
3. Implement the three types of depth-first traversal methods in a binary tree:
a) In-order Traversal: Left -> Root -> Right
b) Pre-order Traversal: Root -> Left -> Right
c) Post-order Traversal: Left -> Right -> Root
4. Write a C program to calculate the height of a binary tree. Ensure the program handles
empty trees situation.
5. Write a C program to perform level-order traversal (breadth-first traversal) of a binary
tree. In level-order traversal, nodes are visited level by level from left to right.