age-viewer
age-viewer copied to clipboard
What are DFS(Depth First Search) and BFS(Breadth First Search) algorithms ?
excited to learn about DFS and BFS
I believe DFS (Depth First Search) is a technique for traversing data in graphs and it uses stack data structure. The DFS is usually a recursive algorithm and it pushes the first visited vertices into the stack and if the next vertex does not exist, then the vertices in the stack are popped. Whereas BFS (Breadth First Search) is a technique for traversing the shortest path in graphs and it uses queue data structure.
Here's some useful information. https://adrianmejia.com/data-structures-for-beginners-graphs-time-complexity-tutorial/
I have written DFS and BFS along with their traversal that is self explanatory. Hope you'll understand it and found this as good solution.
@aked21 @shinhanbyeol DFS and BFS.docx
@shinhanbyeol I guess this will help you. If it is so then you can close this issue.
I have written DFS and BFS along with their traversal that is self explanatory. Hope you'll understand it and found this as good solution.
@aked21 @shinhanbyeol DFS and BFS.docx
Thank you. @Nimra-1234 @MJinH