Resource · Guide or article
Graph
A two-paragraph definition of the graph abstract data type, covering vertices, edges, and the directed versus undirected distinction.
Reviewed
Open the original: Graph (opens the original site in a new tab)Practice this topicOpens the practice interviewer with a question on Graphs.
Add to a roadmap
Keep this resource with a roadmap you follow. It appears as your own extra resource; the roadmap's steps don't change and it doesn't count toward your tracked steps.
Source content: English
Read this in other languages: 简体中文, Русский, Français, Português, Українська In computer science, a graph is an abstract data type that is meant to implement the undirected graph and directed graph concepts from mathematics, specifically the field of graph theory A graph data structure consists of a finite (and possibly mutable) set of vertices or nodes or points, together with a set of unordered pairs of these vertices for an undirected graph or a set of ordered pairs for a directed graph. These pairs are known as edges, arcs, or lines for an undirected graph and as arrows, directed edges, directed arcs, or directed lines for a directed graph. The vertices may be part of the graph structure, or may be external entities represented by integer indices or references.
PrepKit overview
PrepKit editors wrote and reviewed this overview from the source repository. It is not text from the resource itself.
- Suited to
- The source does not state a level
- Format
- Reference
What it covers
- Terminology for undirected and directed edges, with a diagram
- Links to introductory and graph-representation videos
How to use it
PrepKit study advice, not a claim made by the source.
Build an adjacency list and an adjacency matrix for the same small graph, then explain when you would choose each.
Scope and limitations
No adjacency list or matrix discussion, no operations and no complexity table. The useful material is in the linked videos.
Access and format
Short README on GitHub, trekhleb/javascript-algorithms (MIT), with five translations linked. English, free.
Reviewed by PrepKit on Oct 2, 2026. Listing source commit: 85293e3e2b88
Evidence behind this overview
- src/data-structures/graph/README.md
Pages that include this
Get the PrepKit newsletter
Optional. You don't need it to use PrepKit.