Ask Question
10 February, 06:26

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. they are all the same

+5
Answers (1)
  1. 10 February, 07:01
    0
    Option a: a sorted array

    Explanation:

    Since the expectation on the data structure never need to add or delete items, a sorted array is the most desirable option. An array is known for its difficulty to modify the size (either by adding item or removing item). However, this disadvantage would no longer be a concern for this task. This is also the reason, linked list, binary search tree and queue is not a better option here although they offer much greater efficiency to add and remove item from collection.

    On another hand, any existing items from the sorted array can be easily retrieved using address indexing and therefore the data query process can be very fast and efficient.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Suppose that you need to maintain a collection of data whose contents are fixed - i. e., you need to search for and retrieve existing ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers