10.09.2013 Views

1. Advanced Data Structure using C++

1. Advanced Data Structure using C++

1. Advanced Data Structure using C++

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

LECTURE NOTES OF ADVANCED DATA STRUCTURE (MT-CSE 110)<br />

3. If the stack is empty, every node on the graph has been examined<br />

– quit the search and return "not found".<br />

4. Repeat from Step 2.<br />

5. Exit<br />

Applications of DFS:‐<br />

Algorithms where DFS is used:<br />

• Finding connected components.<br />

• Topological sorting.<br />

• Finding 2‐(edge or vertex)‐connected components.<br />

• Finding strongly connected components.<br />

• Solving puzzles with only one solution, such as mazes. (DFS can be<br />

adapted to find all solutions to a maze by only including nodes on the<br />

current path in the visited set.)<br />

Prepared By :­<br />

Er. Harvinder Singh<br />

Assist Prof., CSE, H.C.T.M (Kaithal) Page ‐ 87 ‐

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!