Skip to main content

Questions tagged [sorting]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
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)$...
Vladimir Dotsenko's user avatar
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 $...
darij grinberg's user avatar
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$....
haz's user avatar
  • 231