15 Graphs

Graphs are one of the fundamental data structures in computer science. They arise throughout numerous problems and programming tasks. Unlike the other data structures in this book, designed to optimize certain computations, the structure of graphs arises naturally from the data itself. In other words, graphs mirror the data they represent. Examining graph algorithms gives us insight into how we can define algorithms to utilize the inherent structure of the data.

Previous chapters focused on the problem of structuring the data to aid the algorithms; high-level problems, such as searching for a value, motivated and drove the design ...

Get Data Structures the Fun Way now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.