Depth First Search | DFS : The Only Tutorial You need | CP Course | EP 70

Поделиться
HTML-код
  • Опубликовано: 12 янв 2025

Комментарии • 466

  • @AzeemKhan-gj7ku
    @AzeemKhan-gj7ku 3 года назад +67

    I don't remember how many videos I have watch to understand DFS/BFS but I was unable to understand the concept....
    This is the best Explanation I have ever watched on RUclips for DFS and now the concept is crystal clear to me....
    Thanks a lot dude for doing that much for us !!!....

    • @PIYUSH-lz1zq
      @PIYUSH-lz1zq 3 года назад

      Yes 👌👌

    • @namandhanotia3570
      @namandhanotia3570 2 года назад

      Could you please send the code he used in the video? I am getting a segmentation fault.

  • @dipankarkumarsingh
    @dipankarkumarsingh 3 года назад +63

    ⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡
    MOST POWER EXPLAIN EVER GOT
    this was One of your own best videos in terms of giving us very deep insight of "Everyone is doing , but why we are doing so : ) "
    from other video I only got to know how to code DFS
    here I learned what controls I can have to modify DFS
    that part was best 🔥🔥🔥🔥🔥

  • @shivi3157
    @shivi3157 2 года назад +7

    I my time I have seen few teacher who able deliver knowledge clearly to students and luv is one of them . 💛

  • @ani68
    @ani68 3 года назад +4

    Literally this is the best DFS explanation I have ever seen....

  • @deepjyotidas37
    @deepjyotidas37 2 года назад +15

    Actually without telling about void->bool of dfs you "returned isLoopExists" . so I have added the code for who haven't understood:
    #include
    using namespace std;
    const int N=10e5;
    bool vis[N]={0};//initialize all the the visited array value as 0 which means false
    vector graph[N];
    void makelink(int s,int d){
    graph[s].push_back(d);
    graph[d].push_back(s);
    }
    void dfs(int v){
    cout

  • @mohitchandra2680
    @mohitchandra2680 3 года назад +24

    DFS was amazing desperately waiting for BFS sir please please please post it asap.

  • @techhelp7657
    @techhelp7657 3 года назад +8

    I have watched almost all videos of your playlist.
    when i started watching your videos i thought how nice it would be you if i watch your tree and graph series now that dream come true ;
    just because of you it will be simple and easy for me to learn graph and trees. Thanks you for such a nice content for free 🙏😊

  • @shadabalam6712
    @shadabalam6712 2 года назад +4

    What an explanation buddy.. thank you soo much.. your channel is the first tutorial whose forcefully made me commenting an applause.. Great explanation keep blessings...

  • @ShyamKumar-l2v5n
    @ShyamKumar-l2v5n 17 дней назад

    One of the best explanation of DFS in the entire yutube ...thank you LUV

  • @tejaswibiduru5131
    @tejaswibiduru5131 2 года назад +3

    Oh my god. This is the most amazing video I saw on DFS. I saw this video few months ago and at that time my Hindi was not that good(I am from south) so I skipped this video. This video made me regret not learning Hindi in my high school. Luv bhai with so much love from Andhra. God bless you.

  • @yuvrajbansaliitbhu2022
    @yuvrajbansaliitbhu2022 9 месяцев назад +2

    Thank you very much bhaiya for this free content

  • @vinayakmishra1244
    @vinayakmishra1244 3 года назад +7

    Thanks is not enough for you man..... ❤️❤️Doing somthing really gr8 for middle class kids...you don't know fam..🙌...

  • @Manish_Sahu
    @Manish_Sahu 3 года назад +2

    seriously you are highly dedicated to make us understand the topic.

  • @amaanhussain3443
    @amaanhussain3443 7 месяцев назад +2

    Easiest explanation on youtube

  • @amanbabu5138
    @amanbabu5138 2 года назад +2

    Really, One of my friend recommend me your channel for Graph, and It is really awesome keep working brother. we are with you.

  • @rajanoobrigaming1450
    @rajanoobrigaming1450 3 года назад +2

    Best DFS ever , crystal clear explanation

  • @breakthebones
    @breakthebones 2 года назад +1

    finally i understood dfs and it was possible only because of u sir

  • @differentone950
    @differentone950 2 года назад

    I am actually not commenting in any video lecture but this explained and it hits in my mind very properly ,
    best explanation of dfs very nice.

  • @astharana3074
    @astharana3074 2 года назад

    seriously you are highly dedicated to make us understand the topic.
    Awesome explanation..!!

  • @visheshsharma9874
    @visheshsharma9874 3 года назад +4

    Bhaiya this a very helpful for all of us thank you for making this content for free💛💛

  • @rishabhchaurasia5378
    @rishabhchaurasia5378 2 года назад

    the best possible logic for solving such qs. Love your explanation

  • @hakishkumarbhondekar6134
    @hakishkumarbhondekar6134 2 года назад

    your are explaining the topic in better way . I love that 🙏

  • @abhimanyukumarroy2539
    @abhimanyukumarroy2539 3 года назад

    💛💛💛💛💛💛ek kyu mai to dherr sare heart dunga.... Bahut accha samjhaya apne, thanks.

  • @nayeemislam8118
    @nayeemislam8118 2 года назад

    Thanks a lot for your effort. I know a thank is very negligible compared to what you have given us. Keep carrying on!

  • @adityavarma1334
    @adityavarma1334 2 года назад

    The way you elaborate each step of any algo is great. ✌✌

  • @codingislit1404
    @codingislit1404 2 года назад

    i just learnt what the importance of why.. just incredible sir🙇‍♂

  • @naha_ne_ja_nahane
    @naha_ne_ja_nahane 3 года назад +2

    Legend is back

    • @TheArchit1
      @TheArchit1 3 года назад

      😂😂😂😂😂😂😂😂

  • @pranshul..
    @pranshul.. 3 года назад +6

    return type void se bool bina kisi notice ke kar diye 😆🤔
    void dfs() se bool dfs()
    BTW 💛

  • @AsifKhanBG
    @AsifKhanBG 3 месяца назад

    best dfs video on internet 🙌

  • @manikantasai6118
    @manikantasai6118 3 года назад

    Ek hi dil hi yaar kitne baar jeetoge 💛💛

  • @Engineer-Md.AkbarHossain
    @Engineer-Md.AkbarHossain Год назад

    Your explanation is powerful

  • @AbhishekTiwari-uj7nj
    @AbhishekTiwari-uj7nj 2 года назад

    This was the best video on DFS

  • @aakashvishwakarma4653
    @aakashvishwakarma4653 3 года назад

    🥰🥰🥰Graph easy lgane lga ab iss video ko dekhkar🥰🥰🥰

  • @parv6853
    @parv6853 Год назад +1

    saare channels pe dekha pr sbse easy treeka yhi tha

  • @priyanshuagarwal912
    @priyanshuagarwal912 2 года назад

    👌👌👌👌👌
    Best explanation
    Much better then many courses

  • @VivekKumar-sp8ng
    @VivekKumar-sp8ng 3 года назад

    you are really a genius keep it up man. your videos are really awesome.

  • @debashisjena8064
    @debashisjena8064 3 года назад +1

    Best explanation of DFS. Waiting for upcoming videos on graph 💛💛

  • @jonayedmohiuddin538
    @jonayedmohiuddin538 Год назад

    what an explanatation... great work

  • @srinivasveligethi2380
    @srinivasveligethi2380 Год назад

    Great Explation. You made it simple bro

  • @taralpatel2718
    @taralpatel2718 2 года назад +1

    very good explaination💛💛

  • @tech_wizard9315
    @tech_wizard9315 3 года назад +4

    There are alot of people who write hate comments on your content,I just wanna say,u r doing a good work,be proud of it N wish you all love!! ❤️❤️
    - Rahul Balani 🙂

    • @abdullasulfikkar5282
      @abdullasulfikkar5282 3 года назад +1

      People who do good stuff are the ones that are hated the most.

  • @shrikantpande1437
    @shrikantpande1437 3 года назад +10

    Sir as a newbie I am struggling a lot with recursion and dp. Can you pls share some tips on how you mastered these two topics and where did you practice from..I would really appreciate it.. Btw thanks for the graph series..

    • @iamluv
      @iamluv  3 года назад +10

      i have made videos on recursion so watch them for more clarity, also both recursion and dp require a lot of practice for getting used to so write a lot of code and solve lot of questions related to them

    • @adityadixit7973
      @adityadixit7973 3 года назад +1

      @@iamluv need more video on recursion and backtracking

    • @farabiislam2418
      @farabiislam2418 3 года назад +1

      See, kunal kushwaha recursion video

    • @Sumanyadav-pe4zw
      @Sumanyadav-pe4zw 3 года назад

      Plz upload some question solving videos.

    • @Sumanyadav-pe4zw
      @Sumanyadav-pe4zw 3 года назад

      Plz upload the next graph video as soon as possible to u.

  • @RahulSharma-jt9qm
    @RahulSharma-jt9qm 3 года назад

    By far best explaination👍👍

  • @_gauravkumar
    @_gauravkumar 3 года назад +1

    Awesome as always💛💛💛💛

  • @Androgamer-yx7tu
    @Androgamer-yx7tu 3 года назад

    💛
    Agar aise DP v karwa dogey
    Bhai dil jeet logey
    Tumhara naam LUV k jaga DILJEET hona chahiye tha
    Kya kamal ka intution bataya
    Mera recursion ka v concept clear kardiya 2nd,3rd section k step se
    🔥Waiting for DP to be completed before March

  • @diptamoy12
    @diptamoy12 3 года назад +1

    Op explanation 💕💕🔥🔥 pls continue series.....

  • @mohammedwaseem8599
    @mohammedwaseem8599 3 года назад +1

    Baaap explanation 🤩🤩

  • @jabalpur_vlog
    @jabalpur_vlog 3 года назад

    Bahut badhiya samjhate ho ap 🤗🤗🤗

  • @ahmedtanjil3648
    @ahmedtanjil3648 2 года назад

    explanation level ✅✅✅up to the limit.... tnx man ♥️

  • @pranjalck
    @pranjalck 2 года назад +1

    Hats off to u luv bhayia, hows the josh⚡⚡💪🏼

  • @HighCaliber20
    @HighCaliber20 3 года назад

    💛💛💛💛Next Level Thankyou Luv bhaiya.

  • @saket61195
    @saket61195 2 года назад

    💛beautiful explanation

  • @sadmansakib3808
    @sadmansakib3808 3 года назад +1

    Luv vai ❤️ from 🇧🇩

  • @kulbhushansingh1101
    @kulbhushansingh1101 2 года назад

    bhaishab mze aagye😍😍😍

  • @swagatjena4292
    @swagatjena4292 3 года назад +1

    In adjancency list of unweighted graph , i think, we have to use vector ??

  • @e.m.hasanprince4609
    @e.m.hasanprince4609 3 года назад

    Now dfs is clear to me. 💛💛💛💛

  • @slimysnail6071
    @slimysnail6071 Год назад

    Thanks a lot for the best explanation

  • @sleekrings620
    @sleekrings620 3 года назад

    I have a genuine doubt. In the line " vector g[N] ;" Are we declaring a vector "g" of size N ? or Are we declaring N vectors - like g[0] , g[1], g[2], g[3],......g[N] ?

    • @iamluv
      @iamluv  3 года назад +3

      we are declaring N vectors, you should check my vector video in stl playlist

  • @divyankvyas9731
    @divyankvyas9731 3 года назад

    💛💛
    Amazing Work Bro

  • @danishraza3061
    @danishraza3061 3 года назад

    Great explanation!
    💛💛

  • @s1mple965
    @s1mple965 3 года назад

    thank you sir ! much needed vide0

  • @adityapatil1245
    @adityapatil1245 2 года назад +1

    Function ka return type bool kaise hua??...aur isLoopExists kaha se aya??

  • @ahmadreza7157
    @ahmadreza7157 2 года назад +1

    simply best..

  • @kumarsunny4358
    @kumarsunny4358 3 года назад

    Awesome explanation👌

  • @VikasKumar-gx5by
    @VikasKumar-gx5by 3 года назад

    Very good explanation

  • @sahilanand30
    @sahilanand30 3 года назад +2

    Explanation level : God 🔥

    • @TheArchit1
      @TheArchit1 3 года назад

      😂😂😂😂😂😂

  • @manishasamanta9321
    @manishasamanta9321 2 года назад

    💛🧡💛
    great explanation! 💯

  • @rahuldorai6628
    @rahuldorai6628 3 года назад

    Amazing video bro love it♥️♥️.Dynamic programming ke upar bhi videos banao na.

  • @aakashvishwakarma4653
    @aakashvishwakarma4653 3 года назад

    Wow , 🤩. Nice Explained...

  • @NikhilKumar-kh2in
    @NikhilKumar-kh2in 3 года назад

    💛💛💛💛💛💛💛 Awesome explanation..!!

  • @nikhil2373
    @nikhil2373 2 года назад +1

    Bhaiya graph me jaise yadi more 1 se 2,4 ar 5th node connected h to yadi hum 'dfs' chalayenge to print 1,2,..... Print hoga par aisa bhi to ho sakta h ki 1,4,..... Or 1,5,...... Print ho to kya ans sahi hoga

  • @itz_me_imraan02
    @itz_me_imraan02 3 года назад

    Great video💛

  • @AmanKumarSinhaOfficial
    @AmanKumarSinhaOfficial 3 года назад

    Very Informative Video

  • @PIYUSH-lz1zq
    @PIYUSH-lz1zq 3 года назад +1

    Bhaiya ek video ka request hai Merge sort for linked list ...buhut prob horaha hai please...

  • @divyanshudwivedi3756
    @divyanshudwivedi3756 Год назад

    you are the best BOSS !!!

  • @ayushshaw3681
    @ayushshaw3681 2 года назад

    Thanks for the video 💛

  • @rickk3300
    @rickk3300 3 года назад +1

    Thank you sir 💛

  • @sahilanand30
    @sahilanand30 3 года назад +1

    Awesome 🔥

  • @Red___Beast
    @Red___Beast Год назад

    best on youtube

  • @kunalhaldiya9291
    @kunalhaldiya9291 3 года назад

    best explanation sir

    • @TheArchit1
      @TheArchit1 3 года назад

      😂😂😂😂😂😂😂

  • @AshishKumar-cw9xw
    @AshishKumar-cw9xw 7 месяцев назад +1

    return isLoopExists, ye kahan se aya

  • @maddycoder1294
    @maddycoder1294 2 года назад

  • @rajvinderkaur4995
    @rajvinderkaur4995 3 года назад +1

    Sir hume pehle tree padna cheye ya firr graph padna cheye

  • @createownhappiness3227
    @createownhappiness3227 2 года назад

    endsem start hone wale h...isme jo DFS btaya h ..... different output de ra h ..and jo material teacher ne dia h...usme LIFO use krr kr output diya h.....pura confusing h last time pe😣😣.....kya follow kru?

  • @aarushiagarwal8938
    @aarushiagarwal8938 2 года назад +2

    I am not able to understand the time complexity of the above DFS function. Why O(V)is added?
    Let 1 vertex E1 edge
    another vertex E2 edges.
    3rd vertex E3 edges.
    TC=O(E1+E2+E3)=O(E).💛💛💛💛💛💛

    • @mystikyogi
      @mystikyogi 2 года назад +3

      How about this -> V1 + E1 + V2 + E2 + V3 + E3 ...
      Can be rewritten as (V1 + V2 ...Vn) + (E1 + E2...En) = O(V+E)

    • @aarushiagarwal8938
      @aarushiagarwal8938 2 года назад +3

      @@mystikyogi thanks now I got it. Thanks for the reply

  • @bilalkhan2298
    @bilalkhan2298 Год назад +4

    bro got a haircut in the middle of a video

  • @sbhanupriya017
    @sbhanupriya017 3 года назад

    Eagerly waiting for new videos..

  • @RaviRaj-tb5od
    @RaviRaj-tb5od 2 года назад

    💛nyc video sir

  • @samarpjain4756
    @samarpjain4756 9 месяцев назад +1

    31:18 cutting kar li

  • @shivamnamdeo5288
    @shivamnamdeo5288 2 года назад

    Thank you greatly 💛 explained but I think some of the part of video is trimmed !!!! how do we call the dfs function from main like which vertex we have to pass to dfs function for calling?? or may start vertex will be given in question itself?!

  • @pranshul..
    @pranshul.. 3 года назад +1

    18:38
    Koi ye batyega kya ki const int N = 1e5+10 mei +10 kyo likhe?
    1e9+7 mei to pata hai +7 prime number banne ke liye per baaki jagh kyo likha jaata hai + ke baad number 🤔

    • @psibarpsi
      @psibarpsi 3 года назад +2

      That's a habit if his. He's said that in a previous video.

  • @nidhikumari1479
    @nidhikumari1479 2 года назад

    Thank you so much ! 💛

  • @sauhaardbatra1680
    @sauhaardbatra1680 2 года назад

    what is the return isLoopExists in the end of the DFS code?

  • @aniruddhmishra6182
    @aniruddhmishra6182 3 года назад

    luv you brother!!!!!!

  • @romenaakter8863
    @romenaakter8863 2 года назад

    Bro,won't it be
    vector g[N]?

  • @rijwanhossain5210
    @rijwanhossain5210 2 года назад

    Can you share the information about the writing tablet you use
    ?

  • @ankitrookies2357
    @ankitrookies2357 3 года назад

    bhai ek sath 1000 like ka option nhi hai kya
    Awessome Explanation bhai

  • @taison0072
    @taison0072 3 года назад

    Bhaiya if weighted graph adjacency list mai dfs kaise lagaenge

  • @princekumar-wt7ne
    @princekumar-wt7ne 3 года назад

    Red heart chhodenge 😄
    ❤️

  • @sundaramanand8788
    @sundaramanand8788 3 года назад

    Which line denotes back tracking from 2 to 6 and so on?