Ask Question

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

+2
Answers (1)
  1. 13 May, 02:50
    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?
Find 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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers