Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  What are the appropriate data structures for ... Start Learning for Free
What are the appropriate data structures for following algorithms?
1) Breadth First Search                           
2) Depth First Search                            
3) Prim's Minimum Spanning Tree                 
4) Kruskal' Minimum Spanning Tree    
  • a)
    1) Stack
    2) Queue
    3) Priority Queue
    4) Union Find
  • b)
    1) Queue
    2) Stack
    3) Priority Queue
    4) Union Find
  • c)
    1) Stack
    2) Queue
    3) Union Find
    4) Priority Queue
  • d)
    1) Priority Queue
    2) Queue
    3) Stack
    4) Union Find
Correct answer is option 'B'. Can you explain this answer?
Most Upvoted Answer
What are the appropriate data structures for following algorithms?1) B...
1) Breadth First Search uses Queue
2) Depth First Search uses Stack
3) Prim's Minimum Spanning Tree uses Priority Queue.
4) Kruskal' Minimum Spanning Tree uses Union Find.
Free Test
Community Answer
What are the appropriate data structures for following algorithms?1) B...
Breadth First Search (BFS):
- BFS explores all the vertices of a graph in breadth-first order, i.e., it visits all the vertices at the same level before moving to the next level.
- The appropriate data structure for BFS is a Queue because it follows the First-In-First-Out (FIFO) order, which is required to visit vertices at the same level before moving to the next level.

Depth First Search (DFS):
- DFS explores all the vertices of a graph in depth-first order, i.e., it visits a vertex and then recursively explores all its adjacent vertices before backtracking.
- The appropriate data structure for DFS is a Stack because it follows the Last-In-First-Out (LIFO) order, which is required for backtracking in DFS.

Prim's Minimum Spanning Tree:
- Prim's algorithm finds the minimum spanning tree of a weighted graph, starting from an arbitrary vertex.
- The appropriate data structure for Prim's algorithm is a Priority Queue because it allows us to select the minimum weight edge efficiently at each step of the algorithm.

Kruskal's Minimum Spanning Tree:
- Kruskal's algorithm finds the minimum spanning tree of a weighted graph by repeatedly adding the minimum weight edges that do not form a cycle.
- The appropriate data structure for Kruskal's algorithm is a Union Find (Disjoint Set) data structure because it efficiently checks for the presence of cycles while adding edges to the spanning tree.

Based on the above explanations, the appropriate data structures for the given algorithms are as follows:
1) Breadth First Search: Queue
2) Depth First Search: Stack
3) Prim's Minimum Spanning Tree: Priority Queue
4) Kruskal's Minimum Spanning Tree: Union Find

Therefore, the correct answer is option 'B':
1) Queue
2) Stack
3) Priority Queue
4) Union Find
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Question Description
What are the appropriate data structures for following algorithms?1) Breadth First Search 2) Depth First Search 3) Prims Minimum Spanning Tree 4) Kruskal Minimum Spanning Tree a)1) Stack2) Queue3) Priority Queue4) Union Findb)1) Queue2) Stack3) Priority Queue4) Union Findc)1) Stack2) Queue3) Union Find4) Priority Queued)1) Priority Queue2) Queue3) Stack4) Union FindCorrect answer is option 'B'. Can you explain this answer? for Computer Science Engineering (CSE) 2025 is part of Computer Science Engineering (CSE) preparation. The Question and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus. Information about What are the appropriate data structures for following algorithms?1) Breadth First Search 2) Depth First Search 3) Prims Minimum Spanning Tree 4) Kruskal Minimum Spanning Tree a)1) Stack2) Queue3) Priority Queue4) Union Findb)1) Queue2) Stack3) Priority Queue4) Union Findc)1) Stack2) Queue3) Union Find4) Priority Queued)1) Priority Queue2) Queue3) Stack4) Union FindCorrect answer is option 'B'. Can you explain this answer? covers all topics & solutions for Computer Science Engineering (CSE) 2025 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for What are the appropriate data structures for following algorithms?1) Breadth First Search 2) Depth First Search 3) Prims Minimum Spanning Tree 4) Kruskal Minimum Spanning Tree a)1) Stack2) Queue3) Priority Queue4) Union Findb)1) Queue2) Stack3) Priority Queue4) Union Findc)1) Stack2) Queue3) Union Find4) Priority Queued)1) Priority Queue2) Queue3) Stack4) Union FindCorrect answer is option 'B'. Can you explain this answer?.
Solutions for What are the appropriate data structures for following algorithms?1) Breadth First Search 2) Depth First Search 3) Prims Minimum Spanning Tree 4) Kruskal Minimum Spanning Tree a)1) Stack2) Queue3) Priority Queue4) Union Findb)1) Queue2) Stack3) Priority Queue4) Union Findc)1) Stack2) Queue3) Union Find4) Priority Queued)1) Priority Queue2) Queue3) Stack4) Union FindCorrect answer is option 'B'. Can you explain this answer? in English & in Hindi are available as part of our courses for Computer Science Engineering (CSE). Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free.
Here you can find the meaning of What are the appropriate data structures for following algorithms?1) Breadth First Search 2) Depth First Search 3) Prims Minimum Spanning Tree 4) Kruskal Minimum Spanning Tree a)1) Stack2) Queue3) Priority Queue4) Union Findb)1) Queue2) Stack3) Priority Queue4) Union Findc)1) Stack2) Queue3) Union Find4) Priority Queued)1) Priority Queue2) Queue3) Stack4) Union FindCorrect answer is option 'B'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of What are the appropriate data structures for following algorithms?1) Breadth First Search 2) Depth First Search 3) Prims Minimum Spanning Tree 4) Kruskal Minimum Spanning Tree a)1) Stack2) Queue3) Priority Queue4) Union Findb)1) Queue2) Stack3) Priority Queue4) Union Findc)1) Stack2) Queue3) Union Find4) Priority Queued)1) Priority Queue2) Queue3) Stack4) Union FindCorrect answer is option 'B'. Can you explain this answer?, a detailed solution for What are the appropriate data structures for following algorithms?1) Breadth First Search 2) Depth First Search 3) Prims Minimum Spanning Tree 4) Kruskal Minimum Spanning Tree a)1) Stack2) Queue3) Priority Queue4) Union Findb)1) Queue2) Stack3) Priority Queue4) Union Findc)1) Stack2) Queue3) Union Find4) Priority Queued)1) Priority Queue2) Queue3) Stack4) Union FindCorrect answer is option 'B'. Can you explain this answer? has been provided alongside types of What are the appropriate data structures for following algorithms?1) Breadth First Search 2) Depth First Search 3) Prims Minimum Spanning Tree 4) Kruskal Minimum Spanning Tree a)1) Stack2) Queue3) Priority Queue4) Union Findb)1) Queue2) Stack3) Priority Queue4) Union Findc)1) Stack2) Queue3) Union Find4) Priority Queued)1) Priority Queue2) Queue3) Stack4) Union FindCorrect answer is option 'B'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice What are the appropriate data structures for following algorithms?1) Breadth First Search 2) Depth First Search 3) Prims Minimum Spanning Tree 4) Kruskal Minimum Spanning Tree a)1) Stack2) Queue3) Priority Queue4) Union Findb)1) Queue2) Stack3) Priority Queue4) Union Findc)1) Stack2) Queue3) Union Find4) Priority Queued)1) Priority Queue2) Queue3) Stack4) Union FindCorrect answer is option 'B'. Can you explain this answer? tests, examples and also practice Computer Science Engineering (CSE) tests.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev