Computer Science · Intermediate

Data Structures & Algorithms

Why one correct program takes a second and another takes a week — and how to tell which you have written.

Lessons
20 lessons
Total runtime
46 hours of video
Modules
6 modules
Optional lessons
17 optional
Start course

Free. No account.

About this course

Two programs can produce identical output and differ by a factor of a million in how long they take. That difference is almost never about the language or the hardware; it is about the arrangement of the data and the shape of the algorithm walking over it. This course is about learning to see that before you run anything.

Big-O notation is the vocabulary and it is simpler than its reputation. It ignores constants and small inputs deliberately, which is exactly what makes it useful: you are not asking how fast this is, you are asking how much worse it gets when the data doubles. An O(n²) loop is invisible on ten items and fatal on ten thousand, and the whole point is to notice at the design stage rather than in production.

The structures themselves each exist because they make one thing cheap. Hash maps make lookup cheap. Trees keep things sorted while staying cheap to insert into. Graphs model relationships nothing else models well. Learning them as a catalogue of tools is far more useful than memorising their implementations — though implementing a few by hand is what makes the catalogue stick.

This is also, frankly, the material technical interviews are drawn from, which is a poor reason to learn it and a real one. About eight hours on the required path, and around forty-six in the pool — three language-specific full courses, a deeper treatment of complexity, and a module on the interview form of this material. Implement as you go in whatever language you know best.

What you'll be able to do

  • Reason about time and space complexity in Big-O terms
  • Choose between an array, a hash map, a tree and a graph on the merits of the operations you need
  • Implement the common structures well enough to understand their trade-offs
  • Recognise the classic algorithm patterns — sorting, searching, traversal — in unfamiliar problems
  • Spot the accidentally quadratic loop before it reaches production

Curriculum

20 lessons · 46 hours

The Vocabulary

4 lessons · 2h 54m

  1. 01CompletedIntro to AlgorithmsCrashCourseVideoBig-O introduced as something useful rather than examinable, in eleven minutes. Start here — the notation is the lens for everything that follows.11m
  2. 02CompletedData StructuresCrashCourseVideoThe catalogue at a glance: arrays, lists, trees, graphs. Ten minutes to know what exists, before spending hours on how each one works.10m
  3. 03CompletedData Structures and Algorithms for BeginnersOptionalProgramming with MoshVideoAn hour that maps the whole territory before you go into any of it — which structures exist, what each is good at, and why anyone cares. The right thing to watch second.1h 19m
  4. 04CompletedLearn Data Structures and Algorithms VisuallyOptionalfreeCodeCamp.orgVideoThe same map drawn rather than described. Take it instead of the lesson above if animations help you more than code does.1h 14m

Complexity

4 lessons · 3h 53m

  1. 05CompletedBig-O Notation for Coding InterviewsOptionalNeetCodeVideoBig-O is the notation the rest of this course is written in, and twenty minutes is enough to read it fluently. Do this before the long structure courses, not after.21m
  2. 06CompletedIntroduction to Big O Notation and Time ComplexityOptionalCS DojoVideoSlower and more careful, working up from counting operations rather than presenting the notation as a fact. Better if the first explanation felt like arbitrary rules.36m
  3. 07CompletedBig O — How Code Slows as Data GrowsOptionalfreeCodeCamp.orgVideoGrounded in measured runtimes rather than notation, which makes the difference between n log n and n squared feel like a real consequence.28m
  4. 08CompletedTime and Space Complexity — Complete TutorialOptionalKunal KushwahaVideoTwo and a half hours including the mathematics — recurrence relations, amortised analysis, space complexity. Far more than most people need, and exactly right if you want to derive rather than memorise.2h 28m

The Structures

1 lesson · 8h

  1. 09CompletedData Structures Easy to Advanced CoursefreeCodeCamp.orgVideoThe spine of the course. Each structure built from first principles with its complexity derived rather than asserted. Long — treat it as several sittings, and implement each structure before moving to the next.8h

The Algorithms

4 lessons · 9h 3m

  1. 10CompletedAlgorithms and Data Structures TutorialOptionalfreeCodeCamp.orgVideoOptional, and a second pass with more weight on the algorithms than the structures. Useful if a particular technique — recursion, dynamic programming, graph traversal — did not land the first time.5h 20m
  2. 11CompletedUnderstanding Sorting AlgorithmsOptionalfreeCodeCamp.orgVideoSorting is the standard worked example for algorithm analysis — half a dozen approaches to one problem, with visibly different costs. Learn the reasoning here and it transfers.1h 12m
  3. 12Completed5 Must-Know Sorting Algorithms Explained and VisualizedOptionalWeb Dev SimplifiedVideoA tighter pass with the code written out for each. Useful as revision before implementing them yourself.33m
  4. 13CompletedEvery Sorting Algorithm Explained in 120 MinutesOptionalKuvina SaydakiVideoComprehensive to the point of being a curiosity — including the ones nobody uses, and better for it, because the bad algorithms explain why the good ones are shaped as they are.1h 58m

In Your Own Language

3 lessons · 19h 42m

  1. 14CompletedData Structures and Algorithms in PythonOptionalfreeCodeCamp.orgVideoTwelve hours implementing everything in Python. The structures courses above are language-agnostic; this is the one to take if you want to type it rather than watch it.12h 31m
  2. 15CompletedData Structures and Algorithms Full CourseOptionalBro CodeVideoFour hours in Java, in short self-contained chapters. The most approachable of the long courses here.4h
  3. 16CompletedData Structures — Full Course for BeginnersOptionalTech With TimVideoThree hours focused on building each structure from scratch rather than using a library version. Doing this once is what makes the difference between recognising a linked list and understanding one.3h 11m

The Interview Form

4 lessons · 2h 19m

  1. 17CompletedLeetCode Was Hard Until I Learned These 8 PatternsOptionalAlgoMonsterVideoInterview questions look infinite and are not. Recognising which of a small number of shapes a problem has is most of the skill, and this is the clearest statement of what those shapes are.21m
  2. 18CompletedData Structure and Algorithm Patterns for LeetCode InterviewsOptionalfreeCodeCamp.orgVideoThe same patterns worked through at length with problems attached. Take it when you have started practising and keep getting stuck at the same point.1h 15m
  3. 19CompletedTop 7 Algorithms for Coding Interviews Explained SimplyOptionalCodebagelVideoTwo pointers, sliding window, binary search and the rest, at speed. Good revision the week before an interview.21m
  4. 20CompletedCoding Interviews — What They Actually Look LikeOptionalNeetCodeVideoHonest context on how much of this material an interview really tests and how the format has been changing. Worth watching before you spend three months on practice problems.22m

Credits

Every lesson in this course was made by one of these channels. Tubeversity sequenced them; it did not make them. If a course is useful to you, the people below are the ones who earned it.