Single Choice
Easy
QWhat is the time complexity of a breadth-first search (BFS) algorithm on a tree with N nodes?
ID: #15256
Time Complexity
160 views
Question Info
#15256Q ID
EasyDifficulty
Time ComplexityTopic
Your Answer
Choose the Best Option
Click any option to instantly check if you're correct.
Correct Answer
Explanation
In a breadth-first search (BFS) algorithm on a tree, each node is visited exactly once, and each edge is traversed once. As a tree has N-1 edges for N nodes, the time complexity of BFS on a tree is proportional to the number of nodes, denoted as O(N).
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic