Login and Register ×
Check your Email for the OTP
Data Structure Time Complexity
⚠ Report ✓ Question Verified Copy Link
Explanation:
In a depth-first search (DFS) 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 DFS on a tree is proportional to the number of nodes, denoted as O(N).
Related Topic:
Share Above MCQ
Learn More MCQ Questions from Data Structure Time Complexity