We can sort a given set of \(n\) numbers by first building a binary search tree consisting of these numbers. Suppose we use insert
to insert the numbers one by one. We then use inorder_walk
to print them in order. What is the worstcase and bestcase running times of this sorting algorithm respectively?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 

1 2 3 4 5 

Problem Loading...
Note Loading...
Set Loading...