Breadth First Traversal for a Graph | GeeksforGeeks

  Рет қаралды 563,726

GeeksforGeeks

GeeksforGeeks

Күн бұрын

Пікірлер: 84
@reyou7
@reyou7 7 жыл бұрын
GeeksforGeeks is always in business!
@shyamprakashm6325
@shyamprakashm6325 4 жыл бұрын
😂😂😂👌👌👌
@anirudh9900
@anirudh9900 6 ай бұрын
Perfect to the point explanation. Thank you!
@rahulrawatlive
@rahulrawatlive 7 жыл бұрын
a crystal clear explanation...very good.
@GeeksforGeeksVideos
@GeeksforGeeksVideos 7 жыл бұрын
Thank you, Rahul.
@shivadeepus4581
@shivadeepus4581 Жыл бұрын
yeah very well explained
@SharminAkter-vi2vt
@SharminAkter-vi2vt 7 жыл бұрын
Slow explanation is very helpful😊
@GeeksforGeeksVideos
@GeeksforGeeksVideos 7 жыл бұрын
Glad you found the explanation helpful. :)
@firstcomesrock8593
@firstcomesrock8593 5 жыл бұрын
this is one of the only videos ive found on graph theory
@pratikshachauhan4152
@pratikshachauhan4152 5 жыл бұрын
Sir firstly thank you very much, but I have some problem due to English subtitle the code under this title is not clearly visible. So please do something to resolve this problem.
@sagarpoudel8534
@sagarpoudel8534 5 жыл бұрын
You can turn off your subtitle in the cc huttom here in taskbar of youtube display area.
@chinmayanand896
@chinmayanand896 8 жыл бұрын
please upload videos on graph theory problem solving....
@ravibramanandam213
@ravibramanandam213 7 жыл бұрын
Shouldn't the time complexity be O(V*E)? because FOR Loop runs for every 1 WHILE loop iteration.
@chandniverma00009
@chandniverma00009 7 жыл бұрын
For the BFS function's complexity, V in O(V+E) is due to the initialization loop and if you notice carefully the second outer while loop's inner for loop statements are run 2E times in total summing over all the outer-while-loop's iterations. They are *not* run O(E) times per outer-while-loop's iteration. Hope that makes things clear for everyone.
@hanq1999
@hanq1999 4 жыл бұрын
I cannot see when does the method push_back() init? Does it belong to library & library ?
@mohneeshgarg8706
@mohneeshgarg8706 5 жыл бұрын
you should teach psedu code first then original code..otherwise it loook it looks just as you make us crame that code
@SergeyFominVL
@SergeyFominVL 5 жыл бұрын
for me it's easier to understand it on real code
@learnwithme510
@learnwithme510 2 жыл бұрын
How we are getting adjacent vertex in the first place? to check if visited or not
@sharmilaharsha4563
@sharmilaharsha4563 5 жыл бұрын
Content delivary, explanation, examples and the flow everything is good but the text appear on the video is hiding the content.... disturbing please correct it.... otherwise it is awesome
@sagarpoudel8534
@sagarpoudel8534 5 жыл бұрын
Turn off the subtitle here in youtube task bar.
@shuvongkorbarman7159
@shuvongkorbarman7159 6 жыл бұрын
After the first item 1 is pop out from the Queue, the queue became empty. And you have used a while loop with the logic (!queue.empty) which means queue is not empty. So according to your logic, the while loop will run only once! Please explain it.
@mrarcticaaa1101
@mrarcticaaa1101 5 жыл бұрын
It will pop first element, then enters the loop and pushes first element's vertexes. So queue won't be empty on second loop of while.
@sachinverma-fu7yl
@sachinverma-fu7yl 7 жыл бұрын
very clear explanation thanks :)
@jayjagtap7873
@jayjagtap7873 Жыл бұрын
Indeed, one of the best explanations on the topic
@jaycrijaygandhi
@jaycrijaygandhi 6 жыл бұрын
I had a doubt that in adjacency list the order in which the nodes in the is arranged, is the order for that specific?
@shoebmoin10
@shoebmoin10 7 жыл бұрын
why does code give a segmentation fault for the following input: Graph g(5); g.addEdge(1, 2); g.addEdge(1, 3); g.addEdge(2, 4); g.addEdge(3, 5); g.addEdge(4, 5);
@gouravmajee9913
@gouravmajee9913 3 жыл бұрын
when g is 5 it means you have allocated 5 space (0-4 vertices) and now you are making and edge with 5 also which is not possible thus make graph g(6) to insert till 5.
@omercak2746
@omercak2746 6 жыл бұрын
Thanks for all these videos Sir
@GeeksforGeeksVideos
@GeeksforGeeksVideos 6 жыл бұрын
Thanks Omer :)
@aanchalsharma5264
@aanchalsharma5264 4 жыл бұрын
How to deallocate the memory that have been allocated using new function
@vaidhyanathansm7625
@vaidhyanathansm7625 4 жыл бұрын
You can make use of delete() function .
@suryanshawasthi1815
@suryanshawasthi1815 4 жыл бұрын
if i will do it by map instead of creating link list will it be considered cheating if someone is testing my knowledge of dsa say in an interview
@jushas9276
@jushas9276 6 жыл бұрын
thank u sir it is very useful
@usmankabeer6776
@usmankabeer6776 3 жыл бұрын
This video is contributed by "illuminati" means ?
@RobertPodosek
@RobertPodosek Жыл бұрын
Except if you did visited[1] you'd get the 2nd position in the array...
@asthajain7207
@asthajain7207 2 жыл бұрын
What about the driver's code
@charleslaine
@charleslaine 6 жыл бұрын
It would help if I could understand the speaker. At 3:01 I literally cannot understand this... "We check if vertex is or not.
@AJ-te4jn
@AJ-te4jn 6 жыл бұрын
adjacent*
@hacking1007
@hacking1007 6 жыл бұрын
realyy asome explanation sir and i suggest more example give
@2708meghu
@2708meghu 7 жыл бұрын
This video is great to understand BFS but I found difficulty in understanding predecessor graph of bfs which is a small topic in bfs chapter. Help me understand that
@GeeksforGeeksVideos
@GeeksforGeeksVideos 7 жыл бұрын
Thank you for your feedback, Megha. I don't think we have an article covering that. Presently, we are only making videos on previously published articles. I have shared this topic with our content team.
@2708meghu
@2708meghu 7 жыл бұрын
Thank You
@himanshupandeynitcs
@himanshupandeynitcs 8 жыл бұрын
Nice explanation with dry run ... (y) (y)
@kiranmallikarjun8618
@kiranmallikarjun8618 6 жыл бұрын
nice one but i didn't get clarity in time omplexity i.e O(v+e)
@guruaribamharish6437
@guruaribamharish6437 6 жыл бұрын
good explanation thank you
@shawarmagames1689
@shawarmagames1689 4 жыл бұрын
Is this Rahul Subramanian by any chance?
@komalkasyap7104
@komalkasyap7104 7 жыл бұрын
very explained video..thanks and keep it up
@GeeksforGeeksVideos
@GeeksforGeeksVideos 7 жыл бұрын
You're welcome, Komal! :)
@sumit12345yadav
@sumit12345yadav 2 жыл бұрын
your TC calculation is wrong, it is O(v*e)
@lionb6725
@lionb6725 6 жыл бұрын
I'm not understanding the logic part clearly. so will u pls clearly expain in another method??
@videovideoguy
@videovideoguy 6 жыл бұрын
A graph can be represented by a Map as well
@chetank1283
@chetank1283 6 жыл бұрын
Hello Sir, Can you help me to solve the problem which is from ACMICPC? I read that problem statement but i am not getting a right way to solve it and i am thinking it is based on graph. So if you help me then i will try to solve the problem.
@md.abdullahalmurad2312
@md.abdullahalmurad2312 5 жыл бұрын
can i get the full code please?
@mirsahib596
@mirsahib596 6 жыл бұрын
i don't get it if you print all the node then how do we know which is the shortest path
@ashrafulfuad2967
@ashrafulfuad2967 6 жыл бұрын
really helpful
@pagalshaitan6495
@pagalshaitan6495 8 жыл бұрын
nice sir
@9ShivamSharma
@9ShivamSharma 7 жыл бұрын
Mistake in adjacent vertices of 5 , you forgot 2.
@GeeksforGeeksVideos
@GeeksforGeeksVideos 7 жыл бұрын
Thank you for pointing this out. We will add the note. Regarding the example, you would not need to do anything for 2 as it is already visited.
@aanandhivb
@aanandhivb 6 жыл бұрын
Its given in the captions
@dividuttunnikrishnan2366
@dividuttunnikrishnan2366 6 жыл бұрын
Unable to see due to Subtitles...of u
@attrey273
@attrey273 3 жыл бұрын
Turn it off
@harshvardhan426
@harshvardhan426 4 жыл бұрын
Sir jisko aap Queue bolrhe hain wo List hai
@pastafarian8410
@pastafarian8410 4 жыл бұрын
what is the meaning of visited[*i] ?
@harshittripathi8935
@harshittripathi8935 4 жыл бұрын
Why bool *visited not bool visited?
@jaatharsh
@jaatharsh 4 жыл бұрын
helpful
@ganeshrocky001
@ganeshrocky001 7 жыл бұрын
show me the spanning tree of dis graph...
@mrarcticaaa1101
@mrarcticaaa1101 5 жыл бұрын
thank you, highly appreciated
@rennesshreddy6656
@rennesshreddy6656 4 жыл бұрын
Sir can you do coding part in c language !!
@khushikumari9910
@khushikumari9910 2 жыл бұрын
Sir code is not visible first make it visible then explain
@rupeshbhujel1005
@rupeshbhujel1005 5 жыл бұрын
thank you!!!
@mahmoudsayed133
@mahmoudsayed133 2 жыл бұрын
very nice and clear thank you (*_*)
@rajamouryasimhareddy1478
@rajamouryasimhareddy1478 3 жыл бұрын
👏👏👏
@udaygupta4516
@udaygupta4516 7 жыл бұрын
You are too slow in explanation.
@GeeksforGeeksVideos
@GeeksforGeeksVideos 7 жыл бұрын
Thank you for your feedback, Uday. We have shared it with our contributor.
@shivankchopra7429
@shivankchopra7429 6 жыл бұрын
In that case I suggest you to watch at 1.25 or 1.5 times speed. I do the same.
@sagarpoudel8534
@sagarpoudel8534 5 жыл бұрын
Those who need faster, plz get lost. Slow is well.
@allhdmoviescene1294
@allhdmoviescene1294 Жыл бұрын
teaching method is so boring
@jigglephysicsresearch
@jigglephysicsresearch 2 жыл бұрын
Clear explaination! Chicks must love you!🤣
Applications of Breadth First Traversal | GeeksforGeeks
9:06
GeeksforGeeks
Рет қаралды 99 М.
Он улетел, но обещал вернуться...
00:30
ПРЕМИЯ ДАРВИНА
Рет қаралды 4,8 МЛН
龟兔赛跑:好可爱的小乌龟#short #angel #clown
01:00
Super Beauty team
Рет қаралды 72 МЛН
What's in the clown's bag? #clown #angel #bunnypolice
00:19
超人夫妇
Рет қаралды 30 МЛН
Depth First Traversal for a Graph | GeeksforGeeks
6:25
GeeksforGeeks
Рет қаралды 480 М.
GRAPH Data Structure | What is Graph? | DSA Course | GeeksforGeeks
14:51
Algorithms: Graph Search, DFS and BFS
11:49
HackerRank
Рет қаралды 956 М.
Graph and its representations | GeeksforGeeks
10:41
GeeksforGeeks
Рет қаралды 485 М.
Breadth First Search Algorithm | Shortest Path | Graph Theory
7:23
WilliamFiset
Рет қаралды 707 М.
Algorithms: Memoization and Dynamic Programming
11:17
HackerRank
Рет қаралды 970 М.
Applications of Depth First Search | GeeksforGeeks
9:02
GeeksforGeeks
Рет қаралды 100 М.
Он улетел, но обещал вернуться...
00:30
ПРЕМИЯ ДАРВИНА
Рет қаралды 4,8 МЛН