Questions tagged [sorting]
The sorting tag has no usage guidance.
3 questions
13
votes
1
answer
8k
views
How can you compute the number of topological sorts in a DAG?
If you have a directed acyclic graph (DAG) $G$, a topological sort is just an ordering of the vertices such that if an edge $x \to y$ exists in $G$, then the index of $x$ is less than the index of $y$....
2
votes
0
answers
32
views
joint rank sequences
An algebraic question I have been working on led me to a sequence that appears in OEIS as A186355: "adjusted joint rank sequence of $(f(i))$ and $(g(j))$ with $f(i)$ before $g(j)$ when $f(i)=g(j)$...
21
votes
1
answer
1k
views
Bubblesort with a twist: a tricky termination
Consider an $n$-tuple $\left(a_1, a_2, \ldots, a_n\right)$ of real numbers. We are allowed to perform the following two moves:
S-moves: We pick two adjacent entries $a_i$ and $a_{i+1}$ satisfying $...