We can sort a given set of
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 worst-case and best-case 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 |
|
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
No explanations have been posted yet. Check back later!