Bubble Sort

Описание

Visualizes bubble sort on an array of 8 colored bars of different heights. Adjacent comparisons trigger swap animations highlighted in orange. Pass and swap counters update live. The O(n²) complexity is displayed after sorting completes.

Bubble Sort

Description

Visualizes bubble sort on an array of 8 colored bars of different heights. Adjacent comparisons trigger swap animations highlighted in orange. Pass and swap counters update live. The O(n²) complexity is displayed after sorting completes.


Phases

# Phase Name Duration Description
1 Title Card 3s Title fades in
2 Array Intro 4s 8 unsorted bars appear with value labels
3 Pass 1 10s Full first pass; largest element bubbles to right
4 Pass 2–3 10s Faster passes; sorted portion grows green
5 Final Passes 6s Remaining passes complete sorting
6 Sorted State 3s All bars green; "Sorted!" banner
7 Complexity 4s O(n²) formula; pass/swap counters summary
8 Outro 2s Fade out

Layout

+------------------------------------------------------+
|                 Bubble Sort                         |
+------------------------------------------------------+
|                                                      |
|             ▌                                        |
|          ▌  ▌                                        |
|       ▌  ▌  ▌  ▌                                    |
|    ▌  ▌  ▌  ▌  ▌  ▌  ▌  ▌                          |
|   [64][34][25][12][22][11][90][70]                  |
|                                                      |
|  Pass: 1          Swaps: 5                          |
|                                                      |
|  (comparing pair highlighted in orange)             |
|                                                      |
|  After sorting:  O(n²)                              |
+------------------------------------------------------+

Area Descriptions

  • Top: Title
  • Center: Bar chart with value labels beneath each bar
  • Bottom left: Pass counter
  • Bottom right: Swap counter
  • Footer: Complexity formula after sorting

Assets & Dependencies

  • Fonts: LaTeX / sans-serif
  • Manim version: ManimCE 0.19.1

Notes

  • Bars have neon green color; comparison pair turns orange
  • Sorted (finalized) bars turn a lighter green/teal
  • Swap animation moves two bars with smooth horizontal translation
  • Comparison highlight: thin orange bracket/underline between compared pair
Аудитория: High SchoolКатегория: Cs
Bubble Sort for High School in Cs | AnimG Library