CSE 2321 Final
Breadth-First Search (BFS) - ANS-Search all directions evenly (i.e., from i, visit all of i's
neighbors, then all of their neighbors, etc.)
- Can find the distance between two vertices
- Can find the distance of all vertices from the source vertex
- Can tell us the number of components of an undirect graph
- Can tell us when an undirect graph is bipartite
Depth First Search - ANS-A search in which children of a node are considered
(recursively) before siblings are considered.
Vertices are white when nothing other than initialization happened to them. Turn gray
when being worked on. Black when algorithm is finished with them.
u.pi is predecessor
u.d is time vertex was discovered
u.f is time algorithm finished with the vertex
Tree Edge - ANS-When the BFS algorithm first encounters the edge, it is pointing from
a gray vertex to a white one
Back Edges - ANS-From a gray vertex to a gray vertex when it encounters is
Forward Edges - ANS-From a gray vertex to a black vertex. If the discovery times for
the gray vertex are less than the black.
Cross Edges - ANS-From gray to black where the tree edges don't make a path. If the
discovery time for the black vertex is less than the gray.
Bipartite Graph - ANS-a graph that can be divided into two sets of vertices where there
are no edges between vertices in the same set
No edges between vertices from the same set.
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller Hkane. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for £6.57. You're not tied to anything after your purchase.