Sorting

Overview

Let n0. The sorting problem refers to permuting records a1,a2,,an into a new sequence a1,a2,,an such that

key(a1)key(a2)key(an).

A few key terms are used to describe properties of sorting algorithms:

Structural Comparison

The #elixir documentation makes a point that there exist two types of comparisons between data types.[1] The first is structural in which comparisons are made on the underlying data structures used to describe the data types. The second is semantic which focuses on making the comparison with respect to what the data types represent.

iex> 1 < :atom  # structural
true
iex> Date.compare(~D[2017-03-31], ~D[2017-04-01])  # semantic
:lt

  1. Structural Comparison ↩︎

Powered by Forestry.md