TubeSum ← Transcribe a video

Big O explained with a deck of cards

Published Aug 14, 2024 Transcribed Jul 14, 2026 F Fireship
Views
⚡ —
VPH
V/S

AI Summary

✂️ Creator Tools: Viral Hooks

AI-generated clip ideas for Shorts based on the transcript

Big O Explained with Cards

45s

Uses a relatable card deck analogy to explain a complex programming concept, making it accessible and shareable.

▶ Play Clip

Bubble Sort vs BOGO Sort

45s

Compares efficient sorting with an absurdly inefficient method, creating humor and contrast that drives engagement.

▶ Play Clip

Binary Search in a Card Deck

45s

Demonstrates a practical algorithm with a clear, visual example that viewers can easily understand and apply.

▶ Play Clip

if you want to get a job as a programmer you need to know Big O imagine you have a shuffled deck of cards if you want to pop one card off the stack that's extremely fast or o of one constant time but if you then want to count the cards you'll need to Loop over the entire deck resulting in O of n or linear time but now let's imagine we need to sort the deck in perfect

order that's going to require a strategy or algorithm like bubble sort where we Loop over the deck repeatedly and swap out adjacent cards until the entire thing is perfectly sorted worst case we Loop over it 52 times giving us o of n^ s or quadratic time alternatively if you're stupid you could throw the cards up in the air and hope that they land perfectly sorted on the ground that's called BOGO sort and gives you o of

n factorial the worst possible time complexity but now we want to find the eight of hearts in the sorted deck instead of looping through every card you could do a binary search by splitting the deck in the middle if the shown card is greater than nine go left otherwise go right continue that process to cut your work in half after every step thus giving you o of log n or logarithmic time

⚡ Saved you time reading this? Transcribe any YouTube video for free — no signup needed.