For each of the following problems, give the worst-case time complexity, assuming that a reasonable algorithm is used. (Note that the "^" symbol is used below to indicate an exponent.)
Question 8
Printing the entire contents of a binary search tree containing n nodes is ...
Question 9
In a complete binary search tree, every non-leaf node has
exactly two children, and every leaf node is at the same depth.
Printing the entire contents of a complete
binary search tree containing n nodes is ...
Question 10
Inserting a new value into a binary search tree containing n nodes ...
Question 11
Inserting a new value into a complete binary search tree containing n nodes is ...
Question 12
Finding the successor of an element in a singly-linked list of n elements, given the key value of the element and a reference to the beginning of the list is ...
Question 13
Finding the successor of an element in a singly-linked list of n elements, given a reference to the element is ...
Question 14
Finding the predecessor of an element in a singly-linked list of n elements, given the key value of the element and a reference to the beginning of the list is ...
Question 15
Finding the predecessor of an element in a singly-linked list of n elements, given a reference to the element is ...
Question 16
Sorting an array of n elements using mergesort is ...