Graph Implementation
This lesson will cover the implementation of a unidirectional graph via adjacency list in C++. We will also go through the time complexity of basic graph operations.
We'll cover the following
Introduction #
At this point, we’ve understood the theoretical logic behind graphs. In this lesson, we will use the knowledge we have to implement the graph data structure in C++. Our graph will have directed edges.
The implementation will be based on the adjacency list model. The linked list class we created earlier will be used to represent adjacent vertices.
As a refresher, here is the illustration of the graph we’ll be producing using an adjacency list:
Create a free account to view this lesson.
Continue your learning journey with a 14-day free trial.
By signing up, you agree to Educative's Terms of Service and Privacy Policy