in Programming in C edited by
827 views
0 votes
0 votes
In DFS traversal every vertex of the graph is visited exactly once. True / False?
in Programming in C edited by
827 views

1 comment

Yes it is False.

In case of recursive DFS node is push onto stack exactly once.

But in Iterative DFS it might get push onto the stack more than once.

source : https://en.wikipedia.org/wiki/Iterative_deepening_depth-first_search

0
0

2 Answers

0 votes
0 votes
TRUE??

1 comment

Given answer is false
0
0
0 votes
0 votes

definite it false.....becoz

when we visit vertex first time we pushed it in to stack and go right,,,,let right child is null then again root vertex is popped and checked for left.......

we can say that no. of times a vertex is visited could be equal to the no. child of a vertex...

1 comment

@hs_yadav

number of child + 1  ?
1
1
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true