Question 1
What is the number of iterations in the following loop?
int count = 5;
while (count < n) {
count = count + 3;
}
◦ n - 3
◦ n / 3 - 1
◦ (n - 5) / 3
◦ the ceiling of (n - 5) / 3
◦ n - 5
Question 2
For a sorted list of 1024 elements, a binary search takes at most ________ comparisons.
◦ 512
◦ 6
◦ 100
◦ 11