What data structure is commonly used in BFS to keep track of visited nodes?
- Linked List
- Queue
- Stack
- Tree
A queue is commonly used in BFS to keep track of visited nodes. The algorithm uses a first-in-first-out (FIFO) order to process nodes level by level, making a queue an appropriate data structure for this purpose.
Loading...
Related Quiz
- How does the suffix tree data structure contribute to solving the longest common substring problem efficiently?
- Consider a scenario where you're implementing a cache system to store frequently accessed data. Discuss how you could utilize a linked list to implement this cache efficiently.
- What is the significance of topological sorting in dependency resolution?
- What are the advantages of using Insertion Sort over other sorting algorithms?
- What are some common use cases for regular expression matching?