DS12_Ch09d - 6 Applications of Depth-First Search a...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
§6 Applications of Depth-First Search /* a generalization of preorder traversal */ void DFS ( Vertex V ) /* this is only a template */ { visited[ V ] = true; /* mark this vertex to avoid cycles */ for ( each W adjacent to V ) if ( !visited[ W ] ) DFS( W ); } /* T = O( |E| + |V| ) as long as adjacency lists are used */ 0 1 2 3 4 5 6 DFS ( 0 ) 1. Undirected Graphs void ListComponents ( Graph G ) { for ( each V in G ) if ( !visited[ V ] ) { DFS( V ); printf(“\n“); } } 7 8 0 1 4 6 5 2 3 7 8 1/6
Image of page 1

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

View Full Document Right Arrow Icon
§6 Applications of Depth-First Search 2. Biconnectivity Articulation point Biconnected graph v is an articulation point if G’ = DeleteVertex( G, v ) has at least 2 connected components. G is a biconnected graph if G is connected and has no articulation points. A biconnected component is a maximal biconnected subgraph. 〖 Example 〖 0 1 2 3 4 8 7 5 6 9 Connected graph 0 1 1 2 3 4 3 5 8 7 7 5 6 7 9 Biconnected components Note: No edges can be shared by two or more biconnected components. Hence E(G) is partitioned by the biconnected components of G.
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern