Simulation Expirment for Proofing the Theoretical Assumption of Time Complexity for Binary Search Tree
Keywords:
Time Complexity, Binary Search Tree, Big O Notation, Recursive Method, Chi square.Abstract
It is frequently asserted that an advantage of a binary search tree implementation of a set over linked list implementation is that for reasonably well balanced binary search trees the average search time (to discover whether or not a particular element is present in the set) is O(log N) to the base 2 where N is the number of element in the set (the size of the tree). This paper presents an experiment for measuring and comparing the obtained binary search tree time with the expected time (theoretical), this experiment proved the correctness of the hypothesis, the experiment is carried out using a program in turbo Pascal with recursion technique implementation and a statistical method to prove the above hypothesis. Search time is estimated by the number of comparisons needed.