VibraXX
Live Quiz Arena
🎁 1 Free Round Daily
⚡ Enter Arena
HomeCategoriesLogic & PuzzlesQuestion
Question
Logic & Puzzles

Which outcome occurs when a depth-first search algorithm encounters a graph with cycles?

A)Algorithm finds shortest path
B)Search halts immediately with error
C)Algorithm may enter infinite loop
D)Search becomes breadth-first instead

💡 Explanation

The algorithm may enter an infinite loop because the same nodes are revisited repeatedly due to the absence of a mechanism preventing re-traversal, therefore it does not halt, find the shortest path, or switch to breadth-first search, rather it gets stuck in cycles.

🏆 Up to £1,000 monthly prize pool

Ready for the live challenge? Join the next global round now.
*Terms apply. Skill-based competition.

⚡ Enter Arena

Related Questions

Browse Logic & Puzzles