Ask Question
7 May, 10:24

What are the benefits of using an ordered list vs. an unordered list? What are the costs?

+2
Answers (1)
  1. 7 May, 13:17
    0
    The main benefit of the ordered list is that you can apply Binary Search (O (n log n)) to search the elements. Instead of an unordered list, you need to go through the entire list to do the search (O (n)).

    The main cost of the ordered list is that every time you insert into a sorted list, you need to do comparisons to find where to place the element (O (n log n)). But, every time you insert into an unsorted, you don't need to find where to place the element in the list (O (1)). Another cost for an ordered list is where you need to delete an element, you have an extra cost rearranging the list to maintain the order.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “What are the benefits of using an ordered list vs. an unordered list? What are the costs? ...” 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