(see the solutions to Problem 5 in Exercises in 2.3 and Problem 2 in Ex-
ercises 5.1), it doesn’t change the linear efficiency class, of course.
d. The smallest (largest) element in a binary search tree is in the left-
most (rightmost) node. To reach it, one needs to start with the root and
follow the chain of left-child (right-child) pointers until a node with the
null left-child (right-child) pointer is reached. Depending on the structure
of the tree, this chain of nodes can be between 1 and nodes long. Hence,
the time of reaching its last node will be in ()The running time of the
entire algorithm will also be linear: ()+()+Θ(1) = ()
11. The puzzle can be solved in two weighings as follows. Start by taking
aside one coin if is odd and two coins if is even. After that divide the
remaining even number of coins into two equal-size groups and put them
on the opposite pans of the scale. If they weigh the same, all these coins
12. The key idea here is to walk intermittently right and left going each time
exponentially farther from the initial position. A simple implementation
of this idea is to do the following until the door is reached: For =01
17