Breadth First Search Algorithm | Shortest Path | Graph Theory

แชร์
ฝัง
  • เผยแพร่เมื่อ 13 ธ.ค. 2024

ความคิดเห็น • 208

  • @sarahzhang8258
    @sarahzhang8258 5 ปีที่แล้ว +256

    the best explanation I 've seen fo far. Simple, clear, and focus without redundant words. Saving a lot of time. Love it and subscribed

    • @shadmansudipto7287
      @shadmansudipto7287 3 ปีที่แล้ว +1

      Agreed

    • @alnnvk3186
      @alnnvk3186 3 ปีที่แล้ว +1

      @Louis Jesse dude you chose the wrong type of people to dump your bs on. computer scientists dgaf about your animal relations.

  • @cam7minus1
    @cam7minus1 3 ปีที่แล้ว +9

    You turned 2 hours of confusing lectures into a simple 7 minute video. Thank you!

  • @shemsnow3711
    @shemsnow3711 2 ปีที่แล้ว +61

    Wow this is such a basic concept I can't believe my teacher couldn't explain it. He just gave us actual code to start out with. Universities seriously need to stop hiring grad students as teachers.

  • @murnoth
    @murnoth 2 ปีที่แล้ว +8

    You're one of the few explaining it with an end node and path reconstruct. Thank you!

  • @dannyfogel9156
    @dannyfogel9156 4 ปีที่แล้ว +55

    Thank you so much!! As a really confused CS student who just started algorithms course this helped me a lot!

    • @luffy-qz4vq
      @luffy-qz4vq 2 หลายเดือนก่อน

      how is it going ?

  • @Andrei-ds8qv
    @Andrei-ds8qv 3 ปีที่แล้ว +7

    Trying for 3 hours to do it myself, came here to see the solution. I forgot the prev array, and In fact even If I visited the whole graph and found the final node, didn't know how to reconstruct everything :D Thanks a lot

  • @viveksuman9600
    @viveksuman9600 3 ปีที่แล้ว +2

    Your animation just clicked it for me. Awesome :)

  • @MrKingoverall
    @MrKingoverall 4 ปีที่แล้ว +25

    I appreciate the effort you put into making these tutorials man. You are the best.

  • @hk32100c18
    @hk32100c18 5 ปีที่แล้ว +13

    You have saved my academic.

  • @anhmai81
    @anhmai81 7 หลายเดือนก่อน +1

    Thanks!

  • @andrewfrenir
    @andrewfrenir 2 ปีที่แล้ว

    The best video about BFS I've watched! Thanks I already understand it! :D

  • @cynderellylastname6060
    @cynderellylastname6060 7 หลายเดือนก่อน +1

    Wow this is by far the most understandable explanation of this concept that I've seen. Thank you!

  • @expansivegymnast1020
    @expansivegymnast1020 3 ปีที่แล้ว +6

    Good explanation. That queue drawing finally helped me get it.

  • @yadav-r
    @yadav-r 2 ปีที่แล้ว +3

    Wow, so many great tutors on the internet already, but you have explained it in a very digestible manner, thank you for your service, this helped me in getting my first dev job.

  • @GovinthanKSAIML
    @GovinthanKSAIML 7 หลายเดือนก่อน +1

    Best explanation ever, hope to see more videos like this from you William! Keep up the good work

  • @jamespottex5197
    @jamespottex5197 4 ปีที่แล้ว

    Best Explanation and Representation for BFS topic on TH-cam...

  • @drygordspellweaver8761
    @drygordspellweaver8761 ปีที่แล้ว

    Currently implementing this "in the wild". Good to see that the "right" way to do it is pretty much what I figured out

  • @sukhrobgolibboev
    @sukhrobgolibboev 5 ปีที่แล้ว +10

    This is the best explanation I've seen so far. Thank you!

  • @Marketblank
    @Marketblank 4 หลายเดือนก่อน

    This Channel is really Helpful and informative and explained very well

  • @matheuscosta5330
    @matheuscosta5330 3 ปีที่แล้ว

    this video is a miracle of learning

  • @panagiotistzakis6799
    @panagiotistzakis6799 ปีที่แล้ว

    Thanks for your time sir ...the best and simple explanation .

  • @chuckchen2851
    @chuckchen2851 3 ปีที่แล้ว +4

    Crystal clear explanation. Many implementation details well covered!

  • @yolowex6876
    @yolowex6876 2 ปีที่แล้ว

    The first half was totally understandable. and the other half... also understandable

  • @zeekcom12
    @zeekcom12 3 ปีที่แล้ว

    Holy crap the queue example is perfect

  • @anhmai81
    @anhmai81 7 หลายเดือนก่อน

    this is an awesome explanation. Thank you very much.

  • @efrainm4649
    @efrainm4649 2 ปีที่แล้ว +1

    This was extremely useful. Thanks!
    Keep working this way!

  • @WingedGlider
    @WingedGlider 3 ปีที่แล้ว

    I love these ones that focus on the actual useful abstraction instead of trying to explain it concretely in mathematics. If I didn't understand the abstract, I wouldn't be studying computer science! Stop putting the cart before the horse!

  • @VOLTDOGmusic
    @VOLTDOGmusic 5 ปีที่แล้ว +19

    Great video!
    Do you mind explaining how the for loop in the reconstructPath method works?
    Specifically,
    for(at = e; at != null; at = prev[at])
    How is this being updated to continue thru the loop?
    Thanks again, William!

    • @WilliamFiset-videos
      @WilliamFiset-videos  5 ปีที่แล้ว +26

      Yeah, the prev array at index i (i.e prev[i]) contains the index of the node used to get to node i. To reconstruct the path we work backwards from the end node 'e' until we reach the start node. The start node does not have a parent so that's why we have 'at != null' as the end condition. Each iteration of the loop you trace back one node, this is 'at = prev[at]'.

    • @VOLTDOGmusic
      @VOLTDOGmusic 5 ปีที่แล้ว +1

      @@WilliamFiset-videos Thanks William! Really appreciate the reply! Keep up the great work!!

    • @bl4ck21
      @bl4ck21 4 ปีที่แล้ว +5

      @@WilliamFiset-videos thanks I also got stuck there

    • @softwarecraftsman3091
      @softwarecraftsman3091 2 ปีที่แล้ว

      @@bl4ck21 In the first iteration, at =e. In the second iteration, at = prev[at]. Each time, at is incrementally progressed to prev[at].

  • @stunning-computer-99
    @stunning-computer-99 6 ปีที่แล้ว +4

    That's a fantastic explanation. re watching BFS for my job interview. thanks mate.

    • @CloroxBleach-hi6jd
      @CloroxBleach-hi6jd 5 ปีที่แล้ว +2

      why the fuck do you need to know that shit for a job interview. Is the interviewer gonna give you a algorithm exam.

    • @ade1819
      @ade1819 5 ปีที่แล้ว +8

      @@CloroxBleach-hi6jd Plenty of job interviews go over your data structure and algorithms knowledge...

    • @CloroxBleach-hi6jd
      @CloroxBleach-hi6jd 5 ปีที่แล้ว +3

      @@ade1819 That's bullshit, if you have the degree than you've taken the class. Fuck algorithms anyway, coding is fun but algorithms are confusing shit

    • @hungp9227
      @hungp9227 5 ปีที่แล้ว +19

      @@CloroxBleach-hi6jd this is why companies don't hire you

    • @CloroxBleach-hi6jd
      @CloroxBleach-hi6jd 5 ปีที่แล้ว +1

      @@hungp9227 I haven't applied dumbass, retarded companies will want you to answer their stupid fucking algorithm questions and give you a job that has nothing to do with algorithms. That's why algorithms are shit

  • @aayush5474
    @aayush5474 4 ปีที่แล้ว

    I could listen to your voice all day

  • @unlucky-777
    @unlucky-777 2 ปีที่แล้ว

    Thanks for the easy and understandable explanation

  • @xeniaioannidou8811
    @xeniaioannidou8811 4 ปีที่แล้ว

    Very good explanation and it is nice that you added pseudocode !!!!

  • @jonathanbenavidesvallejo2870
    @jonathanbenavidesvallejo2870 5 ปีที่แล้ว +2

    You are a legend! Best explanation ever!

  • @angiishere
    @angiishere 2 ปีที่แล้ว

    I am late to the Party but i want to say: Great Tutorial! Exactly what i needed!

  • @meeba-dev
    @meeba-dev 3 ปีที่แล้ว

    Thank you very much William. You are the best!

  • @biaojin5188
    @biaojin5188 4 ปีที่แล้ว +6

    hi thanks for the very clear explaination, but I cannot find the code where we are trying to find the Min or max path from S to E

  • @tkstudiox
    @tkstudiox 5 ปีที่แล้ว +1

    Great video! Thaaanks for the clear explanation.

  • @shanedetsch
    @shanedetsch 3 ปีที่แล้ว +3

    Should not the reconstructPath function definition have ( if at == s { break; } ) in the for loop?

  • @MrSanjaychetwani
    @MrSanjaychetwani ปีที่แล้ว

    Thank you, this was very helpful!

  • @FounderBR
    @FounderBR 2 ปีที่แล้ว

    Thank you so much, it helped a lot! Great video and explanation! (Greetings from Brazil!)

  • @rodrigo10239
    @rodrigo10239 4 ปีที่แล้ว

    Best explanation possible. Thanks a lot!

  • @yashshah1764
    @yashshah1764 3 ปีที่แล้ว

    Thank you bhai! I am grateful for your teachings

  • @albert21994
    @albert21994 4 ปีที่แล้ว +1

    Your videos are the best on graph theory!

  • @gabrielearle1678
    @gabrielearle1678 4 ปีที่แล้ว

    thanks man, amazing video. so straightforward and useful!

  • @archiexzzz
    @archiexzzz 4 ปีที่แล้ว +1

    Best explanation

  • @SatishKumar-jb9qm
    @SatishKumar-jb9qm 4 ปีที่แล้ว

    Thank you - this was easy to understand.

  • @RYANCARNEY-dc2qe
    @RYANCARNEY-dc2qe 4 หลายเดือนก่อน

    Why can't everyone just explain it like this 😂 Fully understood within 3 minutes

  • @prajaktadeokule781
    @prajaktadeokule781 3 ปีที่แล้ว

    thanks for the amazing explanation!

  • @Hajjat
    @Hajjat 5 ปีที่แล้ว +1

    Quality vids.. Subscribed. Thanks for your time and effort!

  • @rakeshv1490
    @rakeshv1490 2 ปีที่แล้ว

    Great videos. Thank you so much.

  • @kamalulazmim3820
    @kamalulazmim3820 3 ปีที่แล้ว

    Very clear, thank you so much!

  • @momke8169
    @momke8169 7 หลายเดือนก่อน

    brilliant video thanks

  • @parasarora5869
    @parasarora5869 5 ปีที่แล้ว +1

    thank you so much !! 😄 ... awesome video 👍

  • @FireboxTrainingCourses
    @FireboxTrainingCourses 4 ปีที่แล้ว

    Awesome video - thank you!

  • @LakshmikanthAyyadevara
    @LakshmikanthAyyadevara 5 ปีที่แล้ว

    best explanation!!!!!! may god bless you

  • @JishnuLOL
    @JishnuLOL ปีที่แล้ว

    Just keep it up. Nice videos

  • @IamKarthraj
    @IamKarthraj 2 ปีที่แล้ว

    Cant thank enough for this !!!

  • @ramansarabha871
    @ramansarabha871 ปีที่แล้ว

    Thanks! You're godsend!

  • @shahidsiddiqui7152
    @shahidsiddiqui7152 3 ปีที่แล้ว

    beautiful explanation :)

  • @vinittodai911
    @vinittodai911 3 ปีที่แล้ว

    One of the best!

  • @kartikkalani6306
    @kartikkalani6306 ปีที่แล้ว

    Thank you sir🙏

  • @allpurposenerd4297
    @allpurposenerd4297 8 วันที่ผ่านมา

    When adding to the queue, does it matter if we did 3,6 instead of 6,3?

  • @happysquirrelwhats-tube8768
    @happysquirrelwhats-tube8768 2 ปีที่แล้ว

    Best of the best! thank you

  • @scienceboy20814
    @scienceboy20814 5 ปีที่แล้ว +9

    How do you know that you are following the shortest path when you reconstruct the path from e? What if there was more than one path to e? Wouldn't the last path to reach e be the one that is set in prev?

    • @silviogames
      @silviogames 4 ปีที่แล้ว +3

      since e is put into the visited array, prev would not be overwritten. I also wondered why always the shortest path is found but since the algorithm is filling the search field from s to e, as soon as e is reached, it has to be the shortest path. all resulting paths are parallely searched on step further so the shortest path to e will always emerge.

    • @An-wd9kk
      @An-wd9kk 4 ปีที่แล้ว +1

      @@silviogames So I interpret your explanation as that the FIRST path being found is the SHORTEST path. Is this correct? And this is achieved by the layering and queueing concept of BFS. The path found first is the path found at the lowest layer (closest to the source node).

    • @silviogames
      @silviogames 4 ปีที่แล้ว

      @@An-wd9kk yeah. lets assume there exist 3 paths to the goal but the algorithm will always move one step at a time so the first that wins has to be the shortest. the others will either be same length or longer

    • @An-wd9kk
      @An-wd9kk 4 ปีที่แล้ว

      @@silviogames yes thank you for your answer.

    • @emin6626
      @emin6626 ปีที่แล้ว +1

      @@silviogames I was trying to understand since two days and you exactly saved me. Thanks for explanation.

  • @karthicksabhapathy993
    @karthicksabhapathy993 4 ปีที่แล้ว +3

    Hi, i have a doubt. Since the values are marked from 0-12, graph.get(node) works perfectly considering the node value is the index value. What if the values aren't like this? Instead of graph.get(node), do we run a for loop to find? Please help & Nice video btw. :)

    • @arvindojha1101
      @arvindojha1101 4 ปีที่แล้ว

      you can map the node value while constructing the the graph using adjacency list or adj matrix.

  • @memedealer6996
    @memedealer6996 27 วันที่ผ่านมา

    6 years late but I do have a question. When you first start the queue why do you choose 9, 7, 11 ? could you also choose 7, 9, 11 or 11, 7, 9 etc.? or is there some reason you chose 9, 7, 11 ?

  • @petrotkach8757
    @petrotkach8757 3 ปีที่แล้ว

    Hello! Why don't you check neighbours for null here 5:42?

  • @ut9910
    @ut9910 4 ปีที่แล้ว

    Awesome explanation easy to understand , animations are great to follow along.Liked 👍and subscribed

  • @cebenbb
    @cebenbb 4 ปีที่แล้ว +7

    Hey, important little thing: krep some padding at the bottom becos of the sub. I watch videos with subs, and i could not see the bottom of the graph.
    Aaaand, cool video :)

  • @aditya7955
    @aditya7955 6 ปีที่แล้ว +5

    Awesome videos william.
    can you maybe discuss this problem.
    there are 'n' nodes and 'm' edges in a graph.
    each node may or may not contain certain number of a item.
    all nodes have same item but different number of that item.
    we have to go from source to destination in minimum time collecting 'k' number of this item.
    each edge is weighted,weights may or may not be same.
    there are no self loops.
    edges are bidirectional.

    • @WilliamFiset-videos
      @WilliamFiset-videos  6 ปีที่แล้ว

      I'm not sure i'm going to cover that problem per se but can you provide a link to the problem?

  • @nickharalampopoulos
    @nickharalampopoulos 5 ปีที่แล้ว +2

    Excellent video! Just a question. The prev array will contain ALL the visited nodes. I can not see how the reconstruct method will return the fastest path. Can anyone explain please?

    • @WilliamFiset-videos
      @WilliamFiset-videos  5 ปีที่แล้ว +3

      True, the prev array contains all nodes, but we're only reconstructing the shortest path between s and e. When we reconstruct the path we begin at e and add the node we used to get to e when we did the BFS (this is prev [e]), then we do the same thing and add prev[prev[e]] to shortest path and so on until we reach s. This will not visit all nodes -- except in the worst case (e.g your graph is a a straight line)

    • @gruuvy8067
      @gruuvy8067 4 ปีที่แล้ว +2

      @@WilliamFiset-videos Hi, this is a little bit late, but I am having trouble understanding how we know which node was the one that led to e, when "prev" seems to hold all the nodes?

    • @nmamano
      @nmamano 4 ปีที่แล้ว

      @@gruuvy8067 The BFS search creates what is called a "BFS tree". The root is the starting node s, and the edges in the tree represent that from a node we visited another node. "prev" maps each node to its parent in the BFS tree. By starting at a node e and following the sequence of parents in the BFS tree, we arrive at the start node s in the shortest number of steps.

    • @roberthoffenheim7861
      @roberthoffenheim7861 3 ปีที่แล้ว

      @@gruuvy8067 In the prev array, you start with searching for the value of the e'th (e is the ending node) index, this value is the node preceding e in the shortest path from s to e. Use that value as the next index to search for in the prev array and so on till you reach the start node s.

    • @sector1734
      @sector1734 3 ปีที่แล้ว

      @@roberthoffenheim7861 why not come to a grinding halt when you hit the end node in function 'solve' - instead of doing all nodes in the try, which seems inefficient

  • @RobertCorrington
    @RobertCorrington 3 ปีที่แล้ว

    The visited queue would contain ALL of the neighbors that were visited, right?
    How would simply reversing the visited queue give you the shortest path? There would be visited neighbors in the queue that were not along the shortest path. How do you prune out those suboptimal neighbors?

  • @Leon-pn6rb
    @Leon-pn6rb 2 ปีที่แล้ว

    It was nice uptill midway, You didn't show, via diagram, the reconstruct path method logic. What happens after 3:00 ?

  • @farruhhabibullaev5316
    @farruhhabibullaev5316 4 ปีที่แล้ว

    Best explanation!

  • @shashankesh
    @shashankesh 4 ปีที่แล้ว +1

    What if there are multiple shortest path for s to e? And I want to retrieve all of them.

  • @ezlyfe9762
    @ezlyfe9762 5 ปีที่แล้ว

    someone i can understand thank god

  • @adamhughes9938
    @adamhughes9938 4 ปีที่แล้ว +2

    Am I missing something or did this not actually talk about how to get the shortest path from BFS? Or did I just lose track? I followed the initial visualization (very helpful) but that didn't show the shortest path right?

    • @euclid9492
      @euclid9492 4 ปีที่แล้ว

      If you look in reconstructPath towards the end around @7:00 and observe that first for loop closely, it starts at the end node, records it and goes to its parent in prev, then it calls that parents prev until null and the only one that should have null listed in prev is the original node s. So by only jumping from child to parent, from end to start this IS the shortest path once we reverse it.

    • @An-wd9kk
      @An-wd9kk 4 ปีที่แล้ว

      @@euclid9492 I don't understand your "only jumping from child to parent" argument. It only implies that the path is non-cyclic or straightforward. It does not imply shortest path. Both path a->b->c and a->d->f->c satisfy that we jump from parent to child, but the former is clearly the shorter path.

    • @euclid9492
      @euclid9492 4 ปีที่แล้ว +3

      @@An-wd9kk That is correct if we are only looking at the reconstruct path function. What we need to remember though, is how we mapped the child to parent INITIALLY in the phase before that. We check a nodes immediate neighbors first so there is no way to get shorter than that. Once a node is visited, it’s parent is recorded and will not be overwritten. Because of this, sure a longer path could exist, but because of the way we stepped out checking immediate neighbors first, the path that we get will be guaranteed to be the shortest path. I had to follow this out on a whiteboard before it clicked, if you have time, I’d recommend doing the same! Hope that clears it up a bit.

    • @excitingfruit
      @excitingfruit 3 ปีที่แล้ว

      @@euclid9492 Thank you

    • @richirossel329
      @richirossel329 ปีที่แล้ว

      @@euclid9492 Everything is probably right in the video but i don't understand what happens (or rather how the right thing would happen) when a node has multiple parent nodes, as only one parent node is is saved in the prev list? And after the first parent node is saved, the "kid" node won't be visited anymore to save any other parent nodes.

  • @anwarulbashirshuaib5673
    @anwarulbashirshuaib5673 3 ปีที่แล้ว

    5:27 shouldn't you add the node you just dequeued to the visited list, so that it won't get added to the queue again in the following iterations?

    • @siddharthshukla4338
      @siddharthshukla4338 3 ปีที่แล้ว

      We have marked it as visited before starting the while loop

  • @bhanuchirutha
    @bhanuchirutha 3 ปีที่แล้ว

    explanation is ok code is complicated

  • @parkerbelholland1037
    @parkerbelholland1037 2 ปีที่แล้ว

    Around 4:50 you mention "value at index i". Sorry, what is the index i? Just trying to understand

  • @rathinsinha5646
    @rathinsinha5646 หลายเดือนก่อน

    how are you using the .get function in list?

  • @ic6406
    @ic6406 ปีที่แล้ว

    Animation for path memorizing/reconstruction would be highly appreciated

  • @rohitkinha3566
    @rohitkinha3566 2 ปีที่แล้ว +1

    How do u create suuch presentation

  • @wjrasmussen666
    @wjrasmussen666 3 ปีที่แล้ว

    what tool do you use to make these diagrams?

  • @jff711
    @jff711 2 ปีที่แล้ว

    Thank you!

  • @curiousmind2330
    @curiousmind2330 ปีที่แล้ว

    Can you please help me...which tool you used for making graphs....I have to make them for my project and your diagrams are very clear 😀

  • @surfingweb1315
    @surfingweb1315 7 หลายเดือนก่อน

    we need an order, right ? it goes like we start from the smallest number to the biggest or backward, am i right ?

  • @robbylinson4868
    @robbylinson4868 ปีที่แล้ว

    Why do we start at 9 after 0? would we not start at 7? how do we determine the order things are added to the queue

  • @Junglemunky
    @Junglemunky ปีที่แล้ว

    When adding the root node's neighbours to the queue, why does it not go in an order (e.g. smallest to largest or vice versa). Is this algorithm just trying to visit every node in the graph as quick as it can?

    • @WilliamFiset-videos
      @WilliamFiset-videos  ปีที่แล้ว +1

      The algorithm will try to explore the entire graph in a breadth first manner. The order in which you add the roots neighbors to the queue doesn't matter for exploration purposes

    • @Junglemunky
      @Junglemunky ปีที่แล้ว

      @@WilliamFiset-videos right, thank you 👍

  • @FINSuojeluskunta
    @FINSuojeluskunta 4 ปีที่แล้ว +1

    I think this one could use a little bit better explanation at the start. DFS is pretty obvious and intuitive but this one left me kind of wondering exactly how a BFS gets you the shortest path.

    • @vikranttandon6253
      @vikranttandon6253 4 ปีที่แล้ว

      Do it with an example, it'll be much more clearer.

    • @jomalomal
      @jomalomal 2 ปีที่แล้ว

      I completely agree. It took me a while to realize that when constructing the prev array we're basically calculating the shortest path to any given node in the graph from the start one.

    • @richirossel329
      @richirossel329 ปีที่แล้ว

      @@jomalomal Everything is probably right in the video but i don't understand what happens (or rather how the right thing would happen) when a node has multiple parent nodes, as only one parent node is is saved in the prev list? And after the first parent node is saved, the "kid" node won't be visited anymore to save any other parent nodes.

  • @briannguyen5057
    @briannguyen5057 3 ปีที่แล้ว

    very helpful!

  • @ParasFtl
    @ParasFtl 2 ปีที่แล้ว +1

    How can we be sure that this is the shortest path?

    • @hezziacGames
      @hezziacGames 7 หลายเดือนก่อน

      Been a whole year 🤣 idek

  • @xxozmozxx
    @xxozmozxx 6 ปีที่แล้ว +1

    thank you sir very helpful but if you talk about algorithm analysis more it would be better.

  • @geneieesqueda8323
    @geneieesqueda8323 2 ปีที่แล้ว

    At 2:07, why is 9 visited first instead of 7?

  • @sephyrion9207
    @sephyrion9207 2 ปีที่แล้ว

    Can this search algorithm be used on weighted graphs?
    If not, what else can be used?

    • @Liam_The_Great
      @Liam_The_Great 2 ปีที่แล้ว

      If there aren’t any negative weights you can use Djikstra’s algorithm. If there are negatie weights, you can use Bellman-Ford

  • @huidihu7498
    @huidihu7498 3 ปีที่แล้ว

    you are a legend

  • @sofianell2557
    @sofianell2557 4 ปีที่แล้ว

    Is there any order for the queue ? Can i add 7 then 11 then 9 for example ? thx

    • @WilliamFiset-videos
      @WilliamFiset-videos  4 ปีที่แล้ว

      The queue will be ordered by layer, but the nodes of any particular layer can appear in any order, so if you start at 0, in the next layer it's valid to add 7, 11 and then 9

  • @matannagar
    @matannagar 4 ปีที่แล้ว

    How do we implement this on a weighted graph?

  • @oleksandrtkach416
    @oleksandrtkach416 3 ปีที่แล้ว

    Complexity O(V + E) for directed graph, right? For undirected O(V + 2E). Correct me if I am wrong)

  • @gvsharma2643
    @gvsharma2643 5 ปีที่แล้ว

    This is awesome