<p>I think the importance of "sorting almost sorted data quickly" in the database community is because of good streaming and/or parallel algorithms for k-sorting and for k-sorted id generation. (e.g. <a href="http://link.springer.com/chapter/10.1007%2F978-3-540-77050-3_2#page-1" rel="nofollow">http://link.springer.com/chapter/10.1007%2F978-3-540-77050-3_2#page-1</a>) Adaptive sorting is a more general topic: for instance, reverse order would not be what the database community cares about, but would be perfectly reasonable to exploit more generally.</p>

CC BY-SA 3.0
2014-06-28T02:40:34.177Z
2014-06-28T02:40:34.177Z
shaunc
<p>A <a href="http://research.microsoft.com/pubs/209622/patsort-sigmod14.pdf" rel="nofollow">SIGMOD 2014</a> paper from Microsoft Research states that the "importance of sorting almost sorted data quickly has just emerged over the last decade", and goes on to propose variants of Patience sort and Linear Merge, and measure their performance on synthetic "close to sorted" data.</p>

<p>It seems to me that this description matches the theme of "Adaptive Sorting", covering algorithms taking advantage of existing preorder in sequences to be sorted, which has been the topic of various publications (albeit in the community of theoretical computer science rather than databases) from as early as 1979:</p>

<pre><code> - 1979-CTCS Sorting Presorted Files - Mehlhorn
 - 1980-CACM Best Sorting Algorithm For Nearly Sorted Lists - Cook, Kim
 - 1985-TCom Measures Of Presortedness And Optimal Sorting Algorithms - Mannila
 - 1992-ACMCS ASurvey Of Adaptive Sorting Algorithms - Estivill-Castro, Wood
 - 1994-IC Sorting Shuffled Monotone Sequences- Levcopoulos, Petersson
 - 1995-DAM A Framework For Adaptive Sorting - Petersson, Moffat
</code></pre>

<p>Am I missing a key difference between those approaches or is it a mere occurrence of weak communication between the database and TCS communities?</p>

CC BY-SA 3.0
2014-06-27T23:57:25.577Z
I would guess the difference is if we are allowed to assume _a priori_ that the input has some structure, i.e. can I assume that the input is almost sorted or do I need to discover it is almost sorted?
Kaveh
<sorting><adaptive>
What's the difference between "adaptive sorting" and "sorting almost sorted data quickly"?
J.y B.y
# What's the difference between "adaptive sorting" and "sorting almost sorted data quickly"?

(Asked by: username_0 on 2014-06-27)

A SIGMOD 2014 paper from Microsoft Research states that the "importance of sorting almost sorted data quickly has just emerged over the last decade", and goes on to propose variants of Patience sort and Linear Merge, and measure their performance on synthetic "close to sorted" data.
It seems to me that this description matches the theme of "Adaptive Sorting", covering algorithms taking advantage of existing preorder in sequences to be sorted, which has been the topic of various publications (albeit in the community of theoretical computer science rather than databases) from as early as 1979:
 - 1979-CTCS Sorting Presorted Files - Mehlhorn
 - 1980-CACM Best Sorting Algorithm For Nearly Sorted Lists - Cook, Kim
 - 1985-TCom Measures Of Presortedness And Optimal Sorting Algorithms - Mannila
 - 1992-ACMCS ASurvey Of Adaptive Sorting Algorithms - Estivill-Castro, Wood
 - 1994-IC Sorting Shuffled Monotone Sequences- Levcopoulos, Petersson
 - 1995-DAM A Framework For Adaptive Sorting - Petersson, Moffat

Am I missing a key difference between those approaches or is it a mere occurrence of weak communication between the database and TCS communities?

**Tags:** sorting, adaptive

> **Comments:**
> **username_1**: I would guess the difference is if we are allowed to assume _a priori_ that the input has some structure, i.e. can I assume that the input is almost sorted or do I need to discover it is almost sorted?  

---

## 1 answers

### Answer by username_2 on 2014-06-28. Score: 1

I think the importance of "sorting almost sorted data quickly" in the database community is because of good streaming and/or parallel algorithms for k-sorting and for k-sorted id generation. (e.g. <http://link.springer.com/chapter/10.1007%2F978-3-540-77050-3_2#page-1>) Adaptive sorting is a more general topic: for instance, reverse order would not be what the database community cares about, but would be perfectly reasonable to exploit more generally.


---

