Graphs (cont)
Questions we might ask about a graph:
- is there a way to get from item A to item B?
- what is the best way to get from A to B?
- which items are connected?
Graph algorithms are generally more complex than linked list ones:
- no implicit order of items
- graphs may contain cycles
- concrete representation is less obvious
- algorithm complexity depends on connection complexity
|