Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>They are often used behind the scenes in libraries. For example an ordered dictionary data structure (i.e. an <a href="http://en.wikipedia.org/wiki/Associative_array" rel="nofollow noreferrer">associative array</a> that alows sorted traversal by keys) is as likely as not to be implemented using a <a href="http://en.wikipedia.org/wiki/Red-black_tree" rel="nofollow noreferrer">red-black tree.</a> </p> <p>Many data structures (<a href="http://en.wikipedia.org/wiki/Splay_tree" rel="nofollow noreferrer">splay trees</a> come to mind) are interesting for their optimal behaviour in certain circumstances (<a href="http://en.wikipedia.org/wiki/Memory_locality" rel="nofollow noreferrer">temporal locality of reference</a> in the case of splay trees), so they are mainly relevant for use in these cases. In most circumstances the real benefit of a working knowledge of these data structures is to be able to employ them in the right circumstances with a reasonable understanding of their behaviour. </p> <p>Take sorting, for example:</p> <ul> <li><p>In most circumstances <a href="http://en.wikipedia.org/wiki/Quicksort" rel="nofollow noreferrer">quicksort</a> or a modified quicksort that drops to another method when the individual segments get small enough is typically the fastest sorting algorithm for most purposes. However, quicksort tends to show suboptimal behaviour on nearly-sorted data.</p></li> <li><p>the main advantage of a <a href="http://en.wikipedia.org/wiki/Heap_sort" rel="nofollow noreferrer">heap sort</a> is that it can be done in situ with minimal intermediate storage, which makes it quite good for use in memory constrained systems. While it is slower on average (although still n log(n)), it does not suffer from the poor worst case performance of quicksort.</p></li> <li><p>A third example is a <a href="http://en.wikipedia.org/wiki/Merge_sort" rel="nofollow noreferrer">merge sort</a>, which can be done sequentially, making it the best choice for sorting data sets much larger than your main memory. Another name for this is the 'external sort', meaning you can sort using external storage (disk or tape) for intermediate results.</p></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload