230k views
4 votes
Suppose you are implementing the address book feature for a cellphone. The address book needs to be kept sorted by person’s last name and support fast access when queried by last name. Which of the following data structures would be a good choice to use for storing the address book? Justify your answer for both of the following data structures?

User CPPL
by
6.0k points

1 Answer

2 votes

Answer:

Sorted linked list

Step-by-step explanation:

  • A sorted linked list can be used for sorting the last name and support fast access while queried by the last name.
  • The hash table cannot be used because it could have a problem if there would be more buckets to handle than the expected.
  • The binary search table is implemented as the hash table hence both will give the same results.
User MatayoshiMariano
by
5.1k points