Quiz 1
Quiz 1
□ 5
□ 15
□ 9
√
6
9. A binary search is to be performed on the list: [1, 5, 10, 13, 48, 68, 100, 101]. How many
comparisons would it take to find number 101?
□ 1
□ 2
□ 3
√
4 (101 > 13, 101 > 68, 101 > 100, 101 = 101 : number found)
What is the time complexity to insert an element at the end of an array of n elements :
□ O(n)
√
O(1)
□ O(logn)
□ O(nlogn)
10. In an unsorted array, it’s generally faster to find out an item is not in the array than to find
out it is.
□ True
√
False
Page 2