Graphs
Overview
In this lesson, we cover the basics of the node-based data structures known as graphs.
There are two components to this lesson:
- myGA module: Graphs
- If the above link does not take you to the correct module, you can find the lesson in your myGA dashboard.
- In-Class Exercise: Implementing a Graph
The myGA module contains a link to an exercise in CodePen. The code in CodePen is the exact same as the code in the in-class exercises. Try out the exercise in CodePen and see how far you can get with it. Stop when you get stuck and we'll review the solution in class.
Learning Objectives
By the end of this lesson, you'll be able to:
- Define a graph and the difference between undirected and directed graphs.
- Identify how graphs are used in programming.
- Implement a graph.
Prerequisites
- Big O Notation
- Linked lists
- Binary trees
Duration
1.5 hours total:
- 0.5 hour myGA
- 1 hour in class
Additional Resources
- Some graph data structure interview question topics.
- Visualizations of breadth-first search and depth-first search in a graph structure.
- Common interview questions about graphs that don’t necessarily deal with coding.
- Practice building a graph visually.