Multiple Choice
An algorithm that tests whether the first array element is equal to any of the other array elements requires at most n - 1 comparisons, where n is the number of array elements. Which of the following statements is false?
A) If the array has 10 elements, this algorithm requires up to nine comparisons.
B) If the array has 1000 elements, it requires up to 999 comparisons.
C) As n grows larger, the n part of the expression n - 1 "dominates," and subtracting 1 becomes inconsequential. Big O is designed to highlight these dominant terms and ignore terms that become unimportant as n grows.
D) An algorithm that requires a total of n - 1 comparisons is said to be O(n - 1) and is said to have a linear run time.
Correct Answer:

Verified
Correct Answer:
Verified
Q2: What should the question mark (?) in
Q3: The following fibonacci function calculates the nth
Q4: Which of the following statements a), b)
Q5: Which of the following statements a), b)
Q6: Which of the following statements a), b)
Q8: Which of the following statements about the
Q9: Which of the following statements about binary
Q10: Suppose an algorithm is designed to test
Q11: Suppose you have an algorithm that tests
Q12: The following code implements a simple linear