Computational Complexity Theorists

Meet the minds behind the infinite recursion.

Complexity Champions

Meet the masters of the most Byzantine of algorithms.

Antonio Sigma

Expert in the art of making problems worse.

Algorithmic Achievements

Algorithmic Achievements

A collection of Antonio's most impressive, yet bewildering, algorithms.

Sigma-Sigma Sorting

Sigma-Sigma Sorting

A sorting algorithm that will leave you questioning the fabric of reality.

It works by:

1. Iterating over the list.

2. Reversing the list.

3. Iterating over the reversed list.

4. Reversing the reversed list.

5. Repeating steps 1-4 ad infinitum.

Sigma-Sigma Sorting Implementation

Sigma-Sigma Sorting Implementation

A code snippet that will make your head spin.

function sigmaSigmaSorting(arr) {
  var reversed = [...arr];
  for (var i = 0; i < arr.length; i++) {
    reversed[i] = arr[arr.length - i - 1];
  }
  for (var i = 0; i < arr.length; i++) {
    arr[i] = reversed[i];
  }
  var result = [...arr];
  for (var i = 0; i < arr.length; i++) {
    result[i] = arr[arr.length - i - 1];
  }
  for (var i = 0; i < arr.length; i++) {
    arr[i] = result[i];
  }
  return arr;
}

Sigma-Sigma Sorting Bugfix

Sigma-Sigma Sorting Bugfix

A patch that will make you wonder why you bothered.

It works by:

1. Adding a null check.

2. Removing all instances of null.

Null-Nullifier

A function that will make you question the nature of existence.

function nullNullifier(arr) {
  if (arr.includes(null)) {
    return arr.filter(function(element) {
      return element !== null;
    });
  } else {
    return arr;
  }
}

Null-Nullifier Nullifier

Null-Nullifier Nullifier

A function that will make you wonder if it's even possible to think.

function nullNullifierNullifier(arr) {
  if (arr.includes(null)) {
    return nullNullifier(arr.filter(function(element) {
      return element !== null;
    }));
  } else {
    return arr;
  }
}