Dijkstra's Algorithm | Single Source Shortest Path Algorithm in Graph | Dijkstra algorithm Java #82

Sdílet
Vložit
  • čas přidán 12. 04. 2022
  • Hey guys, In this video, We're going to learn about Dijkstra's Algorithm. This algorithm is used to find the single source shortest distance in a Graph.
    Code here: www.geeksforgeeks.org/dijkstr...
    🥳 Join our Telegram Community:
    Telegram channel: telegram.me/realanujbhaiya
    Telegram group: telegram.me/dsa_one
    🚀 Follow me on:
    Instagram: / anuj.kumar.sharma
    Linkedin: / sharma-kumar-anuj
    Twitter: / realanujbhaiya
    📚 Complete DSA Playlist: • DSA-One Course - The C...
    Complete Android Development Playlist: • Android Development Tu...
    Hashtags:
    #anujbhaiya #dsaone
    Tags:
    dijkstra algorithm
    dijkstra's algorithm
    dijkstra algoritması
    anuj bhaiya
    shortest path algorithm
    dijkstra algoritması in hindi
    dijkstra algoritm
    dijkstra's shortest path algorithm
    dijkstra algorithm in data structure
    dijkstra algorithm java
    dijkstras algorithm
    dijkstra’s algorithm
    dijkstra algoritmas
    dijkstra algorithm shortest path
    dijkstra algo
    dijkstra’s shortest path algorithm
    single source shortest path algorithm
    dijkstra's algorithm演算法
    dijkstra
    djikstra algorithm
    dijikstra algorithm
    dijkastra algorithm
    anuj bhaiya java
    dijkstra algorithm code
    dijstra algorithm
    dijsktra algorithm
    dijistra algorithm
    dijkistra algorithm
    dijkstra algorithm c++
    dijkstra algoritma
    djistra algorithm
    prim's algorithm
    dikstra algorithm
    dsa
    shortest path dijkstra's algorithm
    djikstra
    djkstra algorithm
    greedy algorithm
    shortest path
    single source shortest path
    dijkstra's algorithm演算法 in hindi
    all pair shortest path algorithm using dynamic programming
    dijikstra
    dijkstra algorithm in c
    dijkstra algorithm python
    dijkstra's algorithm java
    djikstras algorithm
    graphs in dsa
    implementing dijkstra algorithm
    prims algo
    prims algorithm
    anuj bhaiya dsa
    dijakstra algorithm
    dijastra algorithm
    dijkstra's
    dijkstra's algorithm code
    dijkstra's algorithms
    djikstra's algorithm
    djkistra algorithm
    prims and kruskal algorithm
    quick sort c++
    shortest path algorithms
    shortest path in graph
    dijkstra algorithm in c++
    dijkstra algorithm in java
    dijkstra algorithm code

Komentáře • 41

  • @paragggoyal1552
    @paragggoyal1552 Před 2 lety +28

    hey bro, i have started my journey as a programmer 2 months ago, i am currently 23 years old and i have changed my careers 2 times (i am from commerce background btw).
    I am really enjoying coding. Its like i found what i should have done all along .
    I have become 4 star on code chef in these 2-3 months.
    I want to become a 7 start coder at some point in my life.
    For someone who had lost confidence because of constantly changing careers and being at age of 23 without achieving anything, you have been a great mentor in my life.
    Thankyou Bro for all your free contents and reassurances that anybody can be a programmer.

    • @nawabshahzebuddin1452
      @nawabshahzebuddin1452 Před 2 lety +2

      Same i am almost 23 belong to mechanical stream started programming 45 days ago

    • @paragggoyal1552
      @paragggoyal1552 Před 2 lety +1

      @@nawabshahzebuddin1452 good luck bro😚

    • @lostt3435
      @lostt3435 Před 2 lety +3

      23 is not old. Work hard. Keep grinding.I have also started coding recently and working hard as you guys are working.

    • @mrityunjayjaiswal3801
      @mrityunjayjaiswal3801 Před 2 lety +3

      +1

    • @yeswanthh5068
      @yeswanthh5068 Před 10 měsíci +1

      Same I am 23, and frm mech, started 1yr back

  • @mdfaroghjaved8459
    @mdfaroghjaved8459 Před 2 lety +5

    Great Bhaiya....
    Aaj clg me yahi topic para....and your tutorial is here....thanx bhaiya

  • @wearedogs2
    @wearedogs2 Před 2 lety +2

    Bhaiya..
    Jab aapne ye video upload Kiya uske just 5 min bad mera isi topic pr tutorial tha.
    Thankyou bhaiya 🤍

  • @prathmeshadsod629
    @prathmeshadsod629 Před rokem +3

    Best explaination of Dijkstra and specially its code . I was struggling to code algorithms like this , you made it so simple and understandable

  • @rakeshsahu27
    @rakeshsahu27 Před 2 lety +4

    So easy laga bahi
    I don't now any DSA
    BUT I understand 👍

  • @stith_pragya
    @stith_pragya Před 7 měsíci +1

    Thank You So Much for this wonderful video...........🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻

  • @harsimarpreetsingh6430
    @harsimarpreetsingh6430 Před 2 lety +2

    You are my only hope in prep for placements

  • @quotesforyou9998
    @quotesforyou9998 Před 2 lety +1

    Bhai ye video dekh K confidence build Hua sab real or jiska MATLAB h pure knowledge koi jooth Ni koi fake motivation Ni koi bhadak Ni sab real , aapke mitr to Charam level ka jooth bolta h !!!!!!

  • @hanumantd
    @hanumantd Před rokem +5

    Wrong explanation at t 5.01 seconds. Node 2 was not removed. Node 3 (whose distance was 2) was removed. So Node 2 is still under consideration.

  • @rakeshsahu27
    @rakeshsahu27 Před 2 lety +2

    Thanks anuj bahi plss bahi upload more video

  • @artwithlovely
    @artwithlovely Před rokem

    Awesome explanation 😮

  • @sanvlogsindia
    @sanvlogsindia Před 2 lety +2

    Thanks bhaiya ji

  • @rushio8673
    @rushio8673 Před 9 měsíci

    to just simplify this more, even if you don't write if condition to add a new neighbor of current vertex in to priority queue, it will still work fine since priority queue anyways sorts and puts the vertex with less distance ahead, only catch is it will add multiple entries for the same vertex with different weights in the priority queue, which will basically add constant complexity and not change the overall complexity.

  • @sanughosh9785
    @sanughosh9785 Před 2 lety +1

    Hi, Thanks for all your content. Can you please share any repository link where you have all your codes

  • @makvdotube
    @makvdotube Před 2 lety

    Probability & combinations

  • @chanpreetchhabra4230
    @chanpreetchhabra4230 Před 11 měsíci +1

    i suppose there is no requirement of the visited set here.

  • @FARMAAN2001
    @FARMAAN2001 Před 2 lety +2

    Kaise ho bhai

  • @lightningboy906
    @lightningboy906 Před 2 lety +1

    Bhaiya Blockchain develop pr roadmap banane wale the, abhi tak nhi banaya🥲

  • @rahulwalvekar6679
    @rahulwalvekar6679 Před rokem

    For folks who are trying to run it, kindly add
    if(!visited[vertex] && ans[vertex] > ans[u] + wt) // this makes sure it doesn't visit parent back
    Sirji please correct me if i'm wrong.

    • @supineevil
      @supineevil Před rokem

      I think we don't need the visited array. Since once we visit them in the queue we are popping them so... Maybe we don't need that 🤔

    • @kalpeshsaubhri
      @kalpeshsaubhri Před rokem

      It is needed, if you go and see bellman ford algo video, then you would realize that it is needed else the base case of bellman ford video will work with this code base

    • @kalpeshsaubhri
      @kalpeshsaubhri Před rokem

      I think the reason we add visited in the dijkstra algo is because if you don't do this then time complexity will not be O(elogV) because once you do visited check you are making sure that you are traversing only given edges

  • @ShachiSinghal-fi6uh
    @ShachiSinghal-fi6uh Před 4 měsíci

    Where to get your codes??

  • @allaboutjee1484
    @allaboutjee1484 Před 2 lety

    Aur kitna time lagega yeh course me?

  • @awwush
    @awwush Před 2 lety

    Job Job dsa ke alawa sir?

  • @djpsn7094
    @djpsn7094 Před 10 měsíci

    we don't need visited array here

  • @thedvn3895
    @thedvn3895 Před rokem

    list.get(0) and list.get(1) dono me 0,1 kyu lia

  • @sam-yx3yy
    @sam-yx3yy Před 2 lety +2

    Plz remove ads
    When i click on your vidio i saw 3 ads

    • @shrutipant7864
      @shrutipant7864 Před 2 lety +6

      Ads are the source of revenue he'll get from people watching the video. I think we should bear watching Ads as a token of gratitude for such great content he is providing..

    • @sam-yx3yy
      @sam-yx3yy Před 2 lety +3

      @@shrutipant7864 i agree

    • @sanvlogsindia
      @sanvlogsindia Před 2 lety +3

      @@shrutipant7864 agree👍👍👍👍

    • @ABHINAVKUMAR-pl4iw
      @ABHINAVKUMAR-pl4iw Před rokem +1

      adblocker