Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9005347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:07:14+00:00 2026-06-16T01:07:14+00:00

Given the above graph, the DFS traversal with a stack gives me the folowing

  • 0

enter image description here

Given the above graph, the DFS traversal with a stack gives me the folowing path…

1-2-3-4-5-6

Is the above path valid? Does there exists another path? (my textbook gives me 1-2-3-6-4-5)

I don’t have enough rep to post images over at computer science stack so I had to resort to asking here, not sure if it fits; if it doesn’t I am happy to delete it afterwards.

Thanks,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T01:07:16+00:00Added an answer on June 16, 2026 at 1:07 am

    You have listed a perfectly valid DFS traversal of the graph, and the textbook is giving you another totally legal DFS traversal of the graph. There can be many depth-first traversals of the same graph (in fact, there’s often exponentially many of them), so if you don’t get the same one as your textbook that’s not an immediate cause for alarm.

    Here are some other orderings:

    1 2 5 4 3 6
    3 1 6 2 5 4
    5 4 2 3 1 6
    ...
    

    However, if there are some other rules about how nodes ought to be visited (for example, always visiting connected nodes in ascending or descending order), then a DFS search will always produce the same output.

    Hope this helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

String a=(Yeahhhh) I have finally made it to the (top); Given above String, there
Does anyone know an algorithm for the following problem: Given a undirected connected graph
Given a graph ( shown below), is there an algorithm that allows me to
VBA is throwing the above given error on the line Sheets(Sheet1).Range(A & i).Copy Destination:=Sheets(Sheet2).Range(A
I can't get this code to work. Declared playpauseButton just above the given below
Given an HTML like following: ...more html above... <div class=any_name> <p>Element A goes here</p>
I have 2 divs above each others, at a given moment one is shown
/one_path/some_page.php?var1=value1&var2=value2&var3=value3 Suppose I'm given something like the above. Not just the query variable string,
Tried to install some program, it gives above message requiring 1.1.4322. BUT as the
http://localhost/foo/profile/%26lt%3Bi%26gt%3Bmarco%26lt%3B%2Fi%26gt%3B The url above gives me a 404 Error , the url code is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.