Q. In a tree structure, which traversal method is typically used for searching?
-
A.
BFS
-
B.
DFS
-
C.
Both BFS and DFS
-
D.
Neither BFS nor DFS
Solution
Both BFS and DFS can be used for searching in a tree structure, depending on the specific requirements.
Correct Answer:
C
— Both BFS and DFS
Learn More →
Q. What is a common use of BFS in networking?
-
A.
Finding the maximum flow in a network.
-
B.
Broadcasting messages to all nodes.
-
C.
Finding the shortest path in a weighted graph.
-
D.
Sorting nodes in a network.
Solution
BFS is commonly used for broadcasting messages to all nodes in a network.
Correct Answer:
B
— Broadcasting messages to all nodes.
Learn More →
Q. Which of the following is a real-world application of DFS?
-
A.
Finding the shortest path in a road network.
-
B.
Web crawling.
-
C.
Social network analysis.
-
D.
Network broadcasting.
Solution
DFS is commonly used in web crawling to explore the links on a webpage.
Correct Answer:
B
— Web crawling.
Learn More →
Showing 1 to 3 of 3 (1 Pages)