.. title: Matrix sort demonstration
.. tags:
.. date: 2014/04/08 21:48:08
.. raw:: html
Demonstration of quicksort modified for vector or string comparisons,
as mentioned in Sedgewick's Algorithms in C++. All bugs and mistakes
are my own...
This code solves the problem of removing all duplicate rows from a
square matrix by first sorting the rows, then using the sorted result
to find the first instance of each unique row in the matrix.
The goal was to improve the best case of the algorithm. For this
algorithm, the "run all random" is the best case, because given enough
columns and unique values, the sort won't have to even look at many of
the values in the matrix. The worst case is the "run equal until last
column", because every value in the matrix is examined, and the last
column will take some time to sort.
Here is the code_.
.. _code: ./matrixsort.js
.. raw:: html

rows

columns

num unique (for non-constant cases)

.. Delete these comments after running
.. Can add your own meta data too.
.. use TEASER _ END to mark the end of the teaser section
.. add a draft tag to drafts.