๐Ÿ“ข Too many exams? Donโ€™t know which one suits you best? Book Your Free Expert ๐Ÿ‘‰ call Now!

  • google app store apple app store
  • โœ–

      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