Ask Question
14 April, 17:55

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

+3
Answers (1)
  1. 14 April, 18:24
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers