{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lecture23

# Lecture23 - Airline routes Admin PQueue due Pathnder out...

This preview shows pages 1–4. Sign up to view the full content.

Admin PQueue due, Pathfinder out Joy poll Today’s topics Graphs and graph algorithms Reading Ch 11 hashing (next) Lecture #23 Airline routes Word ladders Course prerequisites

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Flowcharts Propose Flirt shamelessly Flirt aimlessly Trombone serenade Date Be single & love it 2-phase commit Get married Have baby! Have two, they're small! Mazes Social networks Graphs Another recursive data structure Node with any number of pointers to other nodes No restrictions on connectivity (allows disconnected, multiple paths, cycles) Terminology Node, arc, directed, connected, path, cycle B E C A D F
Implementation strategies Set of all arcs {a->b, a->c, b->d, c->d, d->a, d->b} Adjacency list a: {b, c} b: {d} c: {d} d: {a, b} Adjacency matrix Consider: sparse vs dense, space vs time a b c d a b c d x x x x x x B C A D Representing graphs in C++ struct nodeT { // data for node goes here Vector<nodeT *> connected; // or Set }; Graph itself is Set/Vector of node * Why not just pointer to root, like tree?

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}