January 2024
Intermediate to advanced
480 pages
12h 36m
English

We used the adjacency list data structure—and algorithms on it—to solve graph problems in Chapters 5 and 6. That’s an efficient data structure that works no matter the graph problem. However, if we constrain the types of problems we want to solve, we can design an even more efficient data structure. Constrain the problems just a little, and we likely wouldn’t be able to do any better than an adjacency list. Constrain them too much, and few people would use our data structure because it would be unlikely to solve problems that they cared about solving. Constrain the problems just right and you have the union-find data structure, the ...
Read now
Unlock full access