# Questions tagged [sorting]

Sorting is the process of arranging similar items according to a predefined order.

9 questions
110 views

### A robust algorithm to sort a non-convex polygon vertices

Let v_{0},...,v_{N-1} be N points in a Cartesian xy plane defining the vertices of closed polygon (i.e. v_{N} = v_{0}). Let P_{0}...
72 views

### Maintain sorted ring buffer [closed]

I would like to insert elements into a ring (circular) buffer one at a time and maintain a permutation array which keeps track of the sorted elements in ascending order. To do this, I have adapted the ...
53 views

### LAPACK zlapmt_ freezes code [closed]

I'm using LAPACK's zggev_ routine to solve some generalized eigenvalue problem. While it produces the correct results, I want the eigenvalues and according eigenvectors sorted by absolute value. For ...
38 views

### An algorithm to turn descending order into ascending order, but why correct? [closed]

I wonder why does this algorithm below work well? Many appreciates! Task: Suppose all elements in an array with length $n = 2^m$ are in descending order: $a_1 > a_2 > ... > a_n$, we need to ...
224 views

### extract exhaustive mutually exclusive intervals from larger set of intervals [closed]

I have a collection of time intervals with integer valued endpoints , e.g. (1,2), (2, 6) (5,6), and the number of events falling in each time interval, and I would like to determine if from them I ...
528 views

What is the fastest multithreaded radix sort code out there? I am using radix sort to sort the Morton/Hilbert keys when constructing a tree structure. The number of identical keys is in the range of ...
457 views

### Sorting eigenvalues by the dominant contribution

[Edited to simplify the question] I am trying to associate the eigenvalues $E$ of a matrix $H$ to the original rows of the matrix. Moreover, it would be trivial to sort the eigenvalues in ascending ...