📢 Too many exams? Don’t know which one suits you best? Book Your Free Expert 👉 call Now!


    Question

    Depth-First Search (DFS) typically uses which data

    structure implicitly or explicitly?
    A Queue Correct Answer Incorrect Answer
    B Hash Map Correct Answer Incorrect Answer
    C Stack Correct Answer Incorrect Answer
    D Linked List Correct Answer Incorrect Answer
    E Array Correct Answer Incorrect Answer

    Solution

    DFS explores as far as possible along each branch before backtracking. This "last-in, first-out" (LIFO) behavior is naturally handled by a stack (either explicitly implemented or implicitly through recursion, which uses the call stack).

    Practice Next
    ask-question