Please look if did right in my answers :
1 Suppose that you need to maintain a collection of data whose contents are fixed— i.e., you need to search for and retrieve existing items, but never need to add or delete items. Although the collection of data may be quite large, you may assume that it can fit in the computer’s memory. Which of the following data structures is the most efficient one to use for this task?
A. a sorted array
B. a linked list
C. a binary search tree
D. a queue
E. all of the above perform the same in this case
My answer is : a binary search tree because its access (get) and search time complexity is O(log n)
2 Which of the following data structures is most appropriate for situations in which you need to efficiently manage (key, value) pairs that are stored on disk?
A. an array
B. a linked list
C. a binary search tree
D. a Map
E. a hash table
My answer is : a hash table because its access (get) is O(n/2) and search time complexity is O(1)
3 A police department wants to maintain a database of up to 1800 license-plate numbers of people who receive frequent tickets so that it can be determined very quicklywhether or not a given license plate is in the database. Speed of response is very important; efficient use of memory is also important, but not as important as speed of response. Which of the following data structures would be most appropriate for this task?
A. a sorted linked list
B. a sorted array with 1800 entries
C. a hash table using open addressing with 1800 entries
D. a hash table using open addressing with 3600 entries
E. a hash table using open addressing with 10000 entries
My answer is : I think a hash table but I do not know the meaning of entries
4 With a poorly chosen hash function, it is possible to have a situation in which the search time in a hash table of N items goes to
A. O(N)
B. O(N!)
C. O(log N)
D. O(N2)
E. O(1)
My answer is : O(1)