Data Structures & Algorithms
Data Structures & Algorithms
Your Progress
Learning goals
Familiarize yourself with common data structures and algorithms such as lists, trees, maps, graphs, Big-O analysis, and more!
Suggested prerequisites
Familiarity with basics programming concepts (e.g. if statements, loops, functions)
Maps/Dictionaries
Maps (also known as Dictionaries) are data structures stores a collection of key-value pairs. Each key is unique and allows for quick access to values. A real life example of a map could be storing the grades for students in a class (student name is key, grade is value).
Quick intro to hash maps
New to the concept of hash maps? Check out this video from Google to learn about what hashmaps are through a fun example! (YouTube)
ESTIMATED TIME: UNDER 10 MINSHow hashmaps work
Hash tables are common data structure used in computer science to store key-value pairs. Check out this video to learn more about hash tables as well as the concept of collisions. (YouTube)
ESTIMATED TIME: 10-20 MINSHash map tutorial (Java, C++)
Check out this interactive tutorial offered by LeetCode to learn about what hash tables are, how they should be implemented, and when they should be used. Examples and practice problems are included! (LeetCode)
Create a phonebook
Want to implement your own contact list? Try your hand at this coding question in which you'll be asked to create a phone book based on given names and numbers. You'll also get practice with hashmaps. (HackerRank)
Four-sum
Interested in getting practice with both hash maps and mathematics? Check out this coding problem in which you're asked to find 4 numbers in an array that add up to a given value. (LeetCode)
Test your knowledge of maps/dictionaries!
Test your knowledge of maps/dictionaries with this short quiz. Even if you're not an expert, this quiz will give you immediate feedback to help you better understand the concepts.
ESTIMATED TIME: UNDER 10 MINS
Linked Lists
Linked Lists, similar to arrays, are a data structure that allow you to store a collection of items in a specific order. Unlike arrays, elements in a linked list are not stored at contiguous memory locations and are instead stored in nodes that are linked using pointers.
Intro to linked lists
Are you new to linked lists? Check out this short video that gives an overview of what linked lists are and how they are used in programming. (YouTube)
ESTIMATED TIME: UNDER 10 MINSLinked list tutorial
Check out this interactive tutorial offered by LeetCode to learn about what linked lists are and how they can be used to solve problems. Practice questions are included! (LeetCode)
Linked list: even or odd
This practice coding problem will help you put your knowledge of linked lists to use! You'll write a function to check if the length of a linked list is even or odd. (GeeksforGeeks)
Test your knowledge of linked lists!
Test your knowledge of linked lists with this short quiz. Even if you're not an expert, this quiz will give you immediate feedback to help you better understand the concepts.
ESTIMATED TIME: UNDER 10 MINS
Trees
Trees are a common non-linear data structure. They don’t store data in a linear way, but instead organize hierarchically. A tree is normally represented by nodes which contain a value and point to other nodes.
Intro to trees
Trees don't just exist in nature, but also exist in computer science as a type of data structure. If you're interested in learning more what a computer science tree is, check out this video. (YouTube)
ESTIMATED TIME: UNDER 10 MINSTypes of trees
Trees are an important data structure in computer science, so it makes sense that many types of trees exist! Learn about the different types of tree data structures you may encounter in programming. (The Crazy Programmer)
ESTIMATED TIME: 10-20 MINSBinary search trees
Check out this video to learn about trees, one of the most commonly used data structures in computer science. (YouTube)
ESTIMATED TIME: UNDER 10 MINSEverything you need to know about trees
We know that trees have roots, branches, and leaves. In computer science, they also have nodes, edges, and ancestors. Learn more about the vocabulary of trees and how to implement them in. (freeCodeCamp)
ESTIMATED TIME: 20-30 MINSSame tree?
This practice coding question will test your knowledge of binary trees by asking you to write a function that checks if two binary trees are identical. (LeetCode)
Is this a binary search tree?
Many types of trees exist in computer science. In this coding question, you'll verify whether or not a given tree is a binary search tree. Hint: Ordering matters here! (HackerRank)
Intro to tries
Have you ever heard of the trie data structure? if you haven't, fear not! This video created by Google gives you a brief explanation of what a trie is and how it's used in programming. (YouTube)
ESTIMATED TIME: UNDER 10 MINSThe trie data structure
Much like a dictionary, a trie stores keys and associated values. Check out this article to learn more about what a trie is and why it's a useful data structure to use when it comes to search. (GitHub)
ESTIMATED TIME: 10-20 MINSReplace words
Interested in getting practice with the trie data structure? Check out this practice problem in which you'll replace words in a sentence based on a dictionary input. (LeetCode)
Test your knowledge of trees!
Test your knowledge of trees with this short quiz. Even if you're not an expert, this quiz will give you immediate feedback to help you better understand the concepts.
ESTIMATED TIME: UNDER 10 MINS
Stacks & Queues
Stacks are a data structure that store a collection of items that inserted and removed according to the last-in first-out (LIFO) principle. Similarly, Queues store items according ot the first-in first-out (FIFO) principle.
Intro to stacks and queues
What's the difference between a queue and a stack? Learn more about these commonly used data structures as well as how ordering works for each in this video with Gayle Laakman McDowell. (YouTube)
ESTIMATED TIME: UNDER 10 MINSStack and queues (Java, C++)
How are stacks and queues used and what's the difference between them? Check out this interactive tutorial by LeetCode to learn more. Examples included! (LeetCode)
Valid parentheses
Interested in testing your knowledge about stacks? Check out this practice coding question in which you'll be asked to validate the ordering of parentheses. (LeetCode)
Test your knowledge of stacks & queues!
Test your knowledge of stacks and queues with this short quiz. Even if you're not an expert, this quiz will give you immediate feedback to help you better understand the concepts.
ESTIMATED TIME: UNDER 10 MINS
Heaps
A heap is a tree-based data structure that usually comes in two varieties: (1) Max-heaps where the the value in any node is greater than all the values in it's child nodes and (2) Min-heaps where the value in any node is less than all of the values in it's child nodes.
How heaps work
This short video will help you learn a heap (excuse the pun!) about the heap data structure as well as how input can be inserted and removed from it. (YouTube)
ESTIMATED TIME: 10-20 MINSLearning to love heaps
Interested in learning more about heaps and why they're useful? Check out this article from BaseCS which explains what a heap is and discusses different types of heaps, such as min and max heaps. (Medium)
ESTIMATED TIME: 20-30 MINSHeap operations
This practice coding question is designed to help you get a better understanding of basic heap operations. You'll write code to add and delete values from a heap. (HackerRank)
Intro to priority queues
Queues exist both at Starbucks and in computer science. Learn about the priority queue, a unique type of queue, by watching this video from Google. (YouTube)
ESTIMATED TIME: UNDER 10 MINSHow to use priority queues
Check out this tutorial to learn about how a priority queue works and how it can be implemented in different programming languages. (Programiz)
ESTIMATED TIME: 20-30 MINSFind most frequent words
Interested in getting practice implementing priority queues? Try your hand at this problem to identify the most frequently used words in an array. (LeetCode)
Graphs
Graphs are a non-linear data structure considering of nodes and edges (which connect pairs of nodes). Graphs are used to solve many real-life problems and are often used to represent networks (e.g. friends on a social network).
Intro to graphs
Curious about what graphs are? Check out this video to learn about different types of graphs and how they can be implemented. (YouTube)
ESTIMATED TIME: 10-20 MINSGraphs: depth and breadth first search
This video explains depth first search (DFS) and breadth first search (BFS), two commonly used algorithms in computer science used to traverse graphs or trees. (YouTube)
ESTIMATED TIME: 10-20 MINSBreadth first search
You can implement the breadth first search algorithm both iteratively or recursively! Check out this article to learn about both approaches through examples. (Techie Delight)
ESTIMATED TIME: 10-20 MINSDepth first search
Depth first search (DFS) is an algorithm used for traversing tree or graph data structures. Learn about DFS, as well as iterative and recursive approaches to implementing the algorithm, in this article. (Techie Delight)
ESTIMATED TIME: 10-20 MINSCourse schedule
Sometimes, you'll need to take a prerequisite before enrolling in a class. Can you help write a function to determine an appropriate course schedule given the prerequisites? (LeetCode)
A* search algorithm
This video created by Google gives you a brief explanation of the A* path-finding search algorithm for graphs, a topic that may come up in coding interviews. (YouTube)
ESTIMATED TIME: UNDER 10 MINSDijkstra's Algorithm
Did you know that Dijkstra's algorithm can be used to help you find the shortest paths between nodes in a graph? Certainly useful if you're looking for the quickest way to get from point A to point B! (GeeksforGeeks)
ESTIMATED TIME: 10-20 MINSRedundant connection
Check out this practice coding question to turn one type of data structure into another, specifically a graph into a tree! (LeetCode)
Runtime Analysis
Runtime analysis allows us to measure how efficient code is. Runtime anlaysis is generally done using Big-O notation, which represents how fast code will run in the worst case.
Intro to Big-O notation
Are you new to Big-O notation or need a quick review? Check out this video to learn about Big-O notation and how to analyze the runtimes for your program. (YouTube)
ESTIMATED TIME: UNDER 10 MINSAsymptotic notation
Interested in understanding what makes one algorithm more efficient than another? Learn about the concept of asymptotic notation and how you can use it to measure the running time of your own code. (Khan Academy)
ESTIMATED TIME: UNDER 10 MINSIntro to algorithms
This video from CrashCourse explains what algorithms are: the sets of steps necessary to complete computation. It also reviews how algorithms have developed throughout history. (YouTube)
ESTIMATED TIME: 10-20 MINSBig-O cheat sheet
Know thy complexities! Check out this cheat sheet for a list of time and space complexities associated with the most common algorithms and data structures. (Big-O Cheat Sheet)
ESTIMATED TIME: 10-20 MINSTest your knowledge of runtime analysis!
Test your knowledge of runtime analysis with this short quiz. Even if you're not an expert, this quiz will give you immediate feedback to help you better understand the concepts.
ESTIMATED TIME: UNDER 10 MINS
Searching & Sorting
Searching algorithms are used to Sorting algorithms are used to rearrange a list of elements so that they're in a speciified order (e.g. sorting numbers to go from highest to lowest).
Algorithms: binary search
This short video explains the logic and implementation of the binary search algorithm. It includes helpful examples and visual diagrams to help you better understand the concept. (YouTube)
ESTIMATED TIME: UNDER 10 MINSSorting Algorithm visualizations
Sorting is an essential concept in programming. Learn about the most commonly use sorting algorithms in computer science through this interactive tutorial with examples included. (VisualGo)
LeetCode tutorial: Binary search
Binary search is one of the most useful algorithms to know about when it comes to programming. Check out this tutorial, which goes into depth about binary search and how it's implemented. (LeetCode)
Test your knowledge of searching & sorting!
Test your knowledge of searching & sorting algorithms with this short quiz. Even if you're not an expert, this quiz will give you immediate feedback to help you better understand the concepts.
ESTIMATED TIME: UNDER 10 MINS
Recursion & DP
Recursive algorithms involve a function calling itself in order to solve a smaller version of a problem. Similarly, dynamic programing algorithms break down problems into subproblems in order to solve a larger problem. Although the two concepts aren't exactly the same, dynamic programming solutions are often implemented recursively.
What is recursion?
Are you familiar with recursion? It's a powerful method used in computer science to efficiently solve problems. Learn more from this video which walks you through recursion using an example. (YouTube)
ESTIMATED TIME: UNDER 10 MINSLeetCode tutorial: Recursion (Java, C++)
Recursion can help you break down big problems into smaller, more manageable steps. Learn more about recursion, as well as how you can use it to solve a variety of problems, in this tutorial. (LeetCode)
Find greatest common divisor
This practice coding question asks you to find the greatest common divisor of two integers — without library functions! If you're not sure how to get started, hints are available. (InterviewBit)
Memoization and dynamic programming
If you're new to the concept of memoization or dynamic programming, check out this video to learn the basics while discussing examples of when it would be best to implement these concepts. (YouTube)
ESTIMATED TIME: 10-20 MINSDynamic programming
Dynamic programming is a powerful technique that allows you to solve problems quickly and efficiently. Learn about dynamic programming and how you can apply it to your code. (HackerEarth)
ESTIMATED TIME: 20-30 MINSClimbing stairs
Want to get practice with dynamic programming? Check out this question that asks you to determine the number of ways you can climb a set of stairs. Hint: Break up the problem into smaller steps! (LeetCode)