15. Suppose quicksort is implemented and used to sort a set of integers (18,
20, 14, 19, 30, 3, 7). Which of the following lists could be a valid list just after
the partition function is executed and before quicksort is recursively called
on the two sublists?
a.
20 14 19 30 18 7 3
b.
7 3 18 20 19 14 30
c.
7 3 18 14 19 30 20
d.
30 3 20 7 14 19 18
16. Suppose the Dictionary ADT is implemented and your C program is using
it to store (key, value) pairs. The runtime of the insert operation when the
dictionary has 10 items is 10 ms. When there are 100 items, the runtime is
10.1 ms. When there are 10,000 items in the dictionary, the runtime is 10.5
ms. Which of the following data structures is most likely used to implement
the Dictionary ADT?
a. a binary search tree (not necessarily balanced)
b. a balanced binary search tree
c. a sorted linked list
d. a hash table
17. Suppose you are writing a program to determine if an arithmetic
expression has properly nested () and [] characters. For example, (3+2)*6 +
[(4-6)*8] is a proper expression. Which data structure would you use to write
this program?
a. queue
b. stack
c. linked list
d. graph
18. Suppose you are writing a program for Linkedin to determine how many
"associations" a person is from Father Mark Poorman. For example, Jane
Andrews is two associations away from Father Mark if she is connected to
Professor Miller and Professor Miller is connected to Father Mark. Which data
structure would you use to write this program?
a. queue
b. stack
c. tree
d. graph