Merge Sort — Divide, Conquer, Merge
Zielgruppe: Software EngineerKategorie: Computer Science
Beschreibung
Visualizes the classic merge sort algorithm on an 8-element array [5,3,8,1,9,2,7,4]. The animation shows the recursive divide phase as a tree splitting down to individual elements, then the merge phase rebuilding sorted subarrays from the bottom up. Complexity is displayed as O(n log n).
Merge Sort — Divide, Conquer, Merge
Description
Visualizes the classic merge sort algorithm on an 8-element array [5,3,8,1,9,2,7,4]. The animation shows the recursive divide phase as a tree splitting down to individual elements, then the merge phase rebuilding sorted subarrays from the bottom up. Complexity is displayed as O(n log n).
Phases
| # | Phase Name | Duration | Description |
|---|---|---|---|
| 1 | Intro | 3s | Title and initial array displayed |
| 2 | Divide Phase | 18s | Array recursively splits in half, forming a tree structure downward |
| 3 | Merge Phase | 22s | Pairs merge in sorted order, building back up the tree |
| 4 | Complexity | 5s | O(n log n) formula displayed with annotation |
| 5 | Outro | 5s | Final sorted array highlighted |
Layout
+--------------------------------------------------+
| Title: Merge Sort — Divide, Conquer, Merge |
+--------------------------------------------------+
| |
| [5][3][8][1][9][2][7][4] <- Level 0 (root) |
| |
| [5][3][8][1] [9][2][7][4] <- Level 1 |
| |
| [5][3] [8][1] [9][2] [7][4]<- Level 2 |
| |
| [5][3] [8][1] [9][2] [7][4]<- Level 3 (leaves) |
| |
| (merge back up...) |
| |
| Complexity: O(n log n) bottom-right |
+--------------------------------------------------+
Area Descriptions
- Top strip: Title text
- Center: Tree of array segments, each level rendered as colored boxes
- Bottom right: MathTex complexity label
Assets & Dependencies
- Fonts: LaTeX / sans-serif
- Manim version: ManimCE 0.19.1
Notes
- Color-code elements by original position to track movement across levels
- Use connecting lines between parent and child array segments to show tree structure
- Merge phase shows two pointers scanning across subarrays and combining