# Thanos Sort

> The Thanos Sort is a joke sorting algorithm that removes half of an unsorted list until the remaining elements are in order.

## What is Thanos sort?

The humorous sorting algorithm that randomly deletes half of the elements until only a sorted list remains. Inspired by the fictional character Thanos' idea of random selection.

- Topic: Inefficient Sorting Algorithms
- Type: algorithm, concept

## Interview questions

### Is Thanos sort a real sorting algorithm?

No, it is a joke. It throws away data, so the output is not a sorted version of the input.

### Does Thanos sort always finish?

Yes, the list keeps halving, and one element is always sorted. The total work is O(n), because each round checks a list half the previous size.

### Thanos sort vs Stalin sort: what is the difference?

Thanos sort deletes a random half each round. Stalin sort deletes every element smaller than the one before it in one pass.

## Related cards

- [Stalin Sort](https://wonderium.dev/algorithms/stalin-sort.md)
- [Bogo Sort](https://wonderium.dev/algorithms/bogo-sort.md)
- [Miracle Sort](https://wonderium.dev/algorithms/miracle-sort.md)
- [Comparison Sort](https://wonderium.dev/algorithms/comparison-sort.md)

---

- Level: [Algorithms](https://wonderium.dev/algorithms.md)
- HTML version: https://wonderium.dev/algorithms/thanos-sort
- Last updated: 2026-11-25
