Binary Tree Search

Binary Tree Search implemented in C

Link: GitHub
Module: Algorithms and Data Structures
Graduation Year: 2
This project performs an empirical study of random ordered binary trees. It includes several functions to manipulate and analyze binary trees, such as inserting nodes, counting leaves, computing tree height, searching for data items, and calculating the average number of recursive function calls for successful and unsuccessful searches. The main function conducts a series of experiments to generate random trees, recording statistics on tree height, number of leaves, and the average number of function calls for both hit (successful) and miss (unsuccessful) searches. It also provides an option to output detailed data for a specific tree size if specified through command-line arguments. The code maintains reproducibility by seeding the random number generator and outputs comprehensive data on the characteristics of the generated trees. Additionally, it includes error handling to ensure the correctness of the implemented functions. Overall, this code serves as a valuable tool for analyzing the properties and behavior of random ordered binary trees through empirical observation and statistical analysis.

Binary Tree Search