Video by freeCodeCamp.org · taught by Sumit Saha · streamed from YouTube. All rights remain with the creator.
Lesson 2: Data Structures and Algorithms, Seen Clearly
About this lesson
Data structures and algorithms have a reputation for being heavy on jargon and mathematics. This lesson takes the opposite route and explains each idea with animation, so you see data moving before you ever think about code. It opens with linear structures: arrays, then singly, doubly and circular linked lists, showing how each one stores its items and what that means for reading and inserting. Next come the collections defined by their rules of entry and exit, namely stacks, queues, circular queues, double-ended queues and priority queues. The third part covers hashing, where a hash function turns a key into a position so that lookups become almost instant, and shows how sets use the same trick to filter out duplicates. From there the video moves to structures with branches: heaps, binary search trees, self-balancing AVL and red-black trees, tries for words, and graphs for networks. The fifth part compares ways to search and sort, from linear and binary search to bubble, selection, insertion, merge and quick sort, with attention to how much work each one does. The lesson ends with the big problem-solving strategies: recursion, backtracking, greedy choices, divide and conquer, dynamic programming and Dijkstra's shortest path. No particular programming language is required, because the focus is on logic and trade-offs that apply in all of them. Watch it once straight through for the pictures, then read Chapter 2 of the course book, which adds a comparison table, a growth graph and a binary search worked step by step.