<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/quicksort-vs-merge-sort-reassembling-the-mona-lisa-4k-sorting-masterpieces-6cigwr55k" -->

---
title: Quicksort vs Merge Sort — Reassembling the Mona Lisa...
description: Two real sorting algorithms rebuild the same scrambled Mona Lisa, side by side — and the winner touches FEWER array cells while doing MORE comparisons, not...
canonical: https://daily.dev/posts/quicksort-vs-merge-sort-reassembling-the-mona-lisa-4k-sorting-masterpieces-6cigwr55k
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Quicksort vs Merge Sort — Reassembling the Mona Lisa (4K) | Sorting Masterpieces | daily.dev
og:description: Two real sorting algorithms rebuild the same scrambled Mona Lisa, side by side — and the winner touches FEWER array cells while doing MORE comparisons, not...
og:url: https://daily.dev/posts/quicksort-vs-merge-sort-reassembling-the-mona-lisa-4k-sorting-masterpieces-6cigwr55k
og:image: https://api.daily.dev/og/posts/6CIGwR55k.png
og:image:alt: Quicksort vs Merge Sort — Reassembling the Mona Lisa (4K) | Sorting Masterpieces
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Quicksort vs Merge Sort — Reassembling the Mona Lisa (4K) | Sorting Masterpieces

**[YouTube](https://daily.dev/sources/youtube)** · 1 min read · 0 upvotes · 0 comments

## Summary

Two real sorting algorithms rebuild the same scrambled Mona Lisa, side by side — and the winner touches FEWER array cells while doing MORE comparisons, not fewer.

Both panels start from the identical shuffle of 1,048,576 pixels and rebuild the Mona Lisa, pixel-exact — no morph, no fade, no AI reconstruction. Each pixel keeps its true target position throughout, so as each algorithm sorts, the painting resolves into the original. They're ranked honestly by array accesses — the number of primary-array cells each algorithm touches. That's a visualization metric, not wall-clock speed, so the winner is the one that touches FEWER cells; it is NOT called “faster.”

Here's the twist: Quicksort finishes with fewer array accesses even though it does MORE comparisons. Quicksort's compares read one cell and its swaps move elements in place, while Merge sort's compares read two cells and its merges write results out to a second buffer — so merge's out-of-place moves rack up more total accesses despite fewer comparisons.

The real totals:
• Quicksort — 76,917,118 array accesses (24,098,030 comparisons, 13,204,772 swaps)
• Merge Sort — 81,234,244 array accesses (19,645,602 comparisons, 20,971,520 moves)

Quicksort wins on array accesses, touching 4,317,126 fewer cells.

What you're watching:
• Two panels: Quicksort vs Merge Sort, on the identical 1,048,576-pixel scramble of the Mona Lisa
• Real independent executions — each pixel sorted by value toward its true position
• Ranked by array accesses — cells touched, a visualization metric, not clock speed
• Payoff: both scrambles resolve pixel-exact into the original — no morph, no AI
• Turn your sound on — generative sound driven by the race: a soft pad rises with the action, a bell rings as each algorithm finishes, and a warm chord marks the winner
• Source: Leonardo da Vinci · Wikimedia Commons · Public Domain (faithful reproduction of a PD artwork). Rendered in 4K.

▶ This playlist — Sorting Masterpieces: https://www.youtube.com/playlist?list=PLbTNjjbnu8GM
▶ Narrated deep-dives — Algorithms Behind Everyday Technology: https://www.youtube.com/playlist?list=PLKHf73AsqvIY
▶ More visual art — Algorithms, Visualized: https://www.youtube.com/playlist?list=PLa5DEYngUMDk
🔔 Subscribe to Glass Box Computing: https://www.youtube.com/@GlassBoxComputing?sub_confirmation=1
Real algorithms, rendered as visual art.

#Quicksort #MergeSort #PixelSorting #SortingAlgorithm #MonaLisa #LeonardoDaVinci #ArrayAccesses #4K #GenerativeArt #GlassBoxComputing

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=dBLYe4AHEWw>

---

[View this post on daily.dev](https://daily.dev/posts/quicksort-vs-merge-sort-reassembling-the-mona-lisa-4k-sorting-masterpieces-6cigwr55k)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Quicksort vs Merge Sort — Reassembling the Mona Lisa (4K) | Sorting Masterpieces","url":"https://daily.dev/posts/quicksort-vs-merge-sort-reassembling-the-mona-lisa-4k-sorting-masterpieces-6cigwr55k","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/quicksort-vs-merge-sort-reassembling-the-mona-lisa-4k-sorting-masterpieces-6cigwr55k"},"datePublished":"2026-09-04T00:46:19.260Z","dateModified":"2026-09-04T02:33:17.920Z","description":"Two real sorting algorithms rebuild the same scrambled Mona Lisa, side by side — and the winner touches FEWER array cells while doing MORE comparisons, not...","image":"https://i.ytimg.com/vi/dBLYe4AHEWw/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/dBLYe4AHEWw/sddefault.jpg","isAccessibleForFree":true,"articleSection":"YouTube","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"YouTube","logo":"https://media.daily.dev/image/upload/s--W5zMumpP--/f_auto/v1725350181/logos/youtube","url":"https://daily.dev/sources/youtube"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/quicksort-vs-merge-sort-reassembling-the-mona-lisa-4k-sorting-masterpieces-6cigwr55k","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"","timeRequired":"PT1M","video":{"@type":"VideoObject","name":"Quicksort vs Merge Sort — Reassembling the Mona Lisa (4K) | Sorting Masterpieces","description":"Two real sorting algorithms rebuild the same scrambled Mona Lisa, side by side — and the winner touches FEWER array cells while doing MORE comparisons, not...","thumbnailUrl":"https://i.ytimg.com/vi/dBLYe4AHEWw/sddefault.jpg","uploadDate":"2026-09-04T00:46:19.260Z","duration":"PT1M","url":"https://api.daily.dev/r/6CIGwR55k","embedUrl":"https://www.youtube.com/embed/dBLYe4AHEWw"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"YouTube","item":"https://daily.dev/sources/youtube"},{"@type":"ListItem","position":3,"name":"Quicksort vs Merge Sort — Reassembling the Mona Lisa (4K) | Sorting Masterpieces"}]}
```

