Google Interview Hard Question | Minimum Spanning Tree | CP Course | EP 88

Поділитися
Вставка
  • Опубліковано 22 гру 2024

КОМЕНТАРІ •

  • @dr_davinci
    @dr_davinci 2 роки тому +10

    Here we are looping from 1 to n and calling make(i) ;
    but we are not making 0 , which is also a part of the graph !!!
    here this code works because all the array is initialized with 0 , and the parent[0] = 0 , initially ... so this is why this code works without having to use make(0) ...
    Just pointing this out if anyone had this doubt ( like I had ! )

    • @dhakad22klx
      @dhakad22klx Рік тому +1

      but in code we also initialize size[v]=1,it has not been called in case of zero.that will increase timecomplexity relatively.right?

    • @harshrulaniya1720
      @harshrulaniya1720 Рік тому

      please share your code , i am facing some problem

    • @kashishchawla2754
      @kashishchawla2754 7 місяців тому

      ++ @dr_davinci we have to also intilaise the size to be 1 right?, but I guess it will only increase the time complexity therefore the the answer si coming as correct still

    • @AyushRaj-nt3ot
      @AyushRaj-nt3ot 3 місяці тому +1

      Can you please explain this?
      What about size[v]=1 in case of 0th node.

  • @harshitsingh4764
    @harshitsingh4764 2 роки тому +8

    For me it is like, ke jis din luv ki video dekh li wo din productive ho gaya👌🏻.
    Every video is so informational💙

  • @aayushverma6922
    @aayushverma6922 2 роки тому +4

    I always feared graph/tree question but after completing this series, I am more confident in tackling graph questions.
    Loved the whole series 💛

  • @shirishprataya4602
    @shirishprataya4602 2 роки тому +3

    Finally completed all the videos in your competitive programming course. This is really the best on UA-cam. Thanks a lot for helping us. You deserve all appreciations.
    💙💙💙💙💙

    • @aenstetorres273
      @aenstetorres273 6 місяців тому

      How was your journey brother? Can you please give us a review of this whole CP course?

  • @soumya1713
    @soumya1713 2 роки тому +4

    your videos are something diff from others and you are best teacher 😇

  • @joyalmeida6565
    @joyalmeida6565 2 роки тому +1

    this intuition blew my mind! amazing!!

  • @AmanKumarSinhaOfficial
    @AmanKumarSinhaOfficial 3 роки тому +5

    Congratulations.... 100k Completed....

  • @manishmalhotra5387
    @manishmalhotra5387 2 роки тому +1

    one of the best graph playlist.
    i watch lots of youtube video from other channel,but no one teaches better than you. thanks you bhaiya.
    all hearts in one comment💛💚💙

  • @Sha-256-rath
    @Sha-256-rath Рік тому

    10:00 that explanation technique🙏🙏👌👌

  • @sippy8482
    @sippy8482 3 роки тому +17

    Waiting for DP🤞

    • @ani68
      @ani68 3 роки тому

      Aagaya hai bro

  • @anexocelisia9377
    @anexocelisia9377 3 роки тому +5

    which shortcut keys you use for proper indentation of code ? In sublime text?

  • @abdheshdash94
    @abdheshdash94 9 місяців тому

    Love this series 💙💙

  • @anjaliraj4093
    @anjaliraj4093 2 роки тому

    please keep on making these videos.. These are awesome.

  • @336_saranyamaity8
    @336_saranyamaity8 3 роки тому +2

    this problem is beautiful !

  • @ShaliniNegi24
    @ShaliniNegi24 2 роки тому

    Wow, Simply Amazing !! Kudos !!

  • @yashkhatwani3198
    @yashkhatwani3198 2 роки тому +2

    Thank you bhaiya so much . Your all videos were amazing . Got to learn so much. Dua karo ki mera abh triology me ho jaye💛💛💛💛 ❤❤❤❤

  • @keshav9408
    @keshav9408 3 роки тому +10

    *Even I'm not gay but still I love you bro. You are amazing. Already following from beginning. From MANIT Bhopal* 😀

  • @jayagarwal9759
    @jayagarwal9759 2 роки тому +1

    I could not think of the solution, :( nice explanation tho, easily understood , when will I get to this level, agghhhh.

  • @jarvisknows
    @jarvisknows 3 роки тому +2

    such an interesting question!

  • @kumarrahul1917
    @kumarrahul1917 3 роки тому +5

    Bhaiya, Can we just find the MST (to get minimum wiring cost) and then add the minimum of all the costs (to put a power house). Instead of adding one extra node in the tree.

    • @iamluv
      @iamluv  3 роки тому +8

      no, it is possible the two installing two power house in 2 different villages could cost less then connecting those villages with connections

  • @manikantasai6118
    @manikantasai6118 2 роки тому

    💙.U nailed it bro. maza aagaya

  • @sakshi-ok8zu
    @sakshi-ok8zu 2 роки тому

    thanks for the awesome course 💙

  • @vipindhakad7691
    @vipindhakad7691 2 роки тому

    Bhaiya directed graph par bhi ek video banao please!!! Traversal, cycle detection etc

  • @yourbestie4138
    @yourbestie4138 3 роки тому

    this channel is gold

  • @guptashashwat
    @guptashashwat 2 роки тому

    Great Approach

  • @sukhmanpreetsinghsandhub2042
    @sukhmanpreetsinghsandhub2042 3 роки тому

    💙💙💙💙 Awesome video as always.

  • @swarnimagupta4314
    @swarnimagupta4314 2 роки тому +2

    sir , why did you make just n node using make() function, even though you have assumed a additional node 0?

    • @adityachk2002
      @adityachk2002 2 роки тому +1

      Hello

    • @adityachk2002
      @adityachk2002 2 роки тому

      He must have made it with 0 node and might have forgot to include in error correction

  • @binarycode07
    @binarycode07 3 роки тому +1

    Great bhai♥

  • @abhaypratap9898
    @abhaypratap9898 3 роки тому +1

    Luv u luv bhaiya 💗

  • @than0s869
    @than0s869 2 роки тому

    kya solution he sir ak no.

  • @Manish_Sahu
    @Manish_Sahu 2 роки тому

    Amazing trick🤣. after knowing it laughing on myself.

  • @pragatsharma1580
    @pragatsharma1580 3 роки тому

    Nice q and congrats for 100k. When are you going to start dp

  • @arkamukherjee3962
    @arkamukherjee3962 3 роки тому +2

    your contents are just awesome ❤ Love from West Bengal vaiya ❤

  • @varunkamulu8702
    @varunkamulu8702 3 роки тому +2

    Nice question

  • @shreyashverma3644
    @shreyashverma3644 3 роки тому

    Congrats for 100K

  • @sidg2110
    @sidg2110 Рік тому

    Instead of storing the edges in a vector, I stored them in set. I then iterated over the set to form the MST. For some reason, using a set is causing a TLE error on testcase-7. I believe both methods have same time complexity. Any reason why using a set is slower?

    • @mradultiwari9864
      @mradultiwari9864 Місяць тому

      n = 2000 so total TC of the solution will be using set which performs operations in log n --> O(n^2*logn(dsu ki tc)*logn(due to set)) gives total of O(around 2*2*1e6*10*10 = 4*1e8) which leads to TLE but without set tc will be only -> O(4*1e7 which is acceptable in 1s) by removing logn factor due to set......( log (n) = log(2000) ~ 10)
      I hope your doubt will be cleared

  • @vaibhavgupta6600
    @vaibhavgupta6600 3 роки тому

    awesome video 🔥🔥🔥

  • @shashankarora2945
    @shashankarora2945 11 місяців тому

    Brilliancy!

  • @jitendrakumar-vv8ho
    @jitendrakumar-vv8ho 5 місяців тому

    algouniversity ke intern ke interview me merese ye question pucha tha isi ka variation mai nhi bana paya tha yar

  • @VIKAS-fm5un
    @VIKAS-fm5un 3 роки тому

    Congratulations bhai 1L

  • @prathmeshsharma4258
    @prathmeshsharma4258 Рік тому

    Thanks Luv

  • @GGyan.UPSC.
    @GGyan.UPSC. Рік тому +1

    vroh making me proh

  • @physicsmania138
    @physicsmania138 3 роки тому +2

    How many days Will it take to complete this course?

  • @psyck7741
    @psyck7741 Рік тому

    bhaiya you run the loop from 1 to n when you called the make function and still the code works how? shouldn't it be from 0 to n ??

  • @kevalvekariya2482
    @kevalvekariya2482 2 роки тому

    💙💙💙100 th comment for you

  • @itz_me_imraan02
    @itz_me_imraan02 2 роки тому

    Good question🙌 with crystal clear explanation 💙

  • @aledutron
    @aledutron 3 роки тому

    💛Thank You💛

  • @adityachk2002
    @adityachk2002 2 роки тому +1

    Woww

  • @GeniuslyTensai
    @GeniuslyTensai 3 роки тому

    Bhaiya please graphs pr or bhi questions or uske intuitions discuss krna. This topic really gets on my nerves.

  • @abhisheksharma7056
    @abhisheksharma7056 2 роки тому

    after knowing it's MST problem then this will take 5 min to think of this solution;

  • @Vishnukumar-pj6io
    @Vishnukumar-pj6io 3 роки тому

    Welcome in comming back💔💔❣️

  • @travellersboys4622
    @travellersboys4622 2 роки тому

    Op bhai

  • @immortalphoenix8886
    @immortalphoenix8886 Місяць тому +1

    Demn gud

  • @king-ie1ii
    @king-ie1ii 7 місяців тому

    blue heart

  • @kibriaahmed7512
    @kibriaahmed7512 3 роки тому

    Nice

  • @unknown_coder7960
    @unknown_coder7960 3 роки тому +2

    Bhaiya 930 questions aur 🙂

  • @animalsfightingclub5051
    @animalsfightingclub5051 3 роки тому

    good

  • @darshantrivedi5390
    @darshantrivedi5390 3 роки тому

    🔥🔥

  • @hemantsingh2331
    @hemantsingh2331 Рік тому

    💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛

  • @PirateHunter335
    @PirateHunter335 2 роки тому

  • @user-zo9ye6de5e
    @user-zo9ye6de5e 3 роки тому

    ye medium level ka hai ? Phir hard kaisa hoga ? 😌😑

    • @iamluv
      @iamluv  3 роки тому +2

      It cf 1900 rated question which is medium only, cf 2000+ rated questions are hard imo

  • @p38_amankuldeep75
    @p38_amankuldeep75 2 роки тому

    💛💛💛💛💛💛💛

  • @ankitprem4089
    @ankitprem4089 2 роки тому

    💗

  • @kumarsunny4358
    @kumarsunny4358 3 роки тому

    💙💙

  • @TheMaGiCiaN-p7o
    @TheMaGiCiaN-p7o Рік тому

    💙💙💙💙💙💙💙💙💙💙💙💙💙💙

  • @shridharsarraf2188
    @shridharsarraf2188 3 роки тому

    💙💙💙💙

  • @subhasishpanda5390
    @subhasishpanda5390 3 роки тому

    💙

  • @vikrant3011
    @vikrant3011 3 роки тому

    💙💙💙💙💙💙

  • @stuniversalpro7049
    @stuniversalpro7049 3 роки тому

    💙💙💙💙💙💜💜💜💜🖤🖤

  • @AbhishekKumar-fp7bm
    @AbhishekKumar-fp7bm 2 роки тому

    💙💙💙💙

  • @AbhishekKumar-on7zy
    @AbhishekKumar-on7zy 3 роки тому

    💙💙

  • @shivasaini4097
    @shivasaini4097 3 роки тому

    💙

  • @rishav144
    @rishav144 2 роки тому +1

    💛

  • @anowlwithinternet9125
    @anowlwithinternet9125 9 місяців тому

    💛💛💛💛

  • @anuragmishra1991
    @anuragmishra1991 3 роки тому

    💙

  • @allaboutworld5177
    @allaboutworld5177 2 роки тому

    💛

  • @mehoneybadger999
    @mehoneybadger999 3 роки тому

    💙

  • @vk8201
    @vk8201 2 роки тому

    💛

  • @pulkitmittal584
    @pulkitmittal584 3 роки тому

    💙

  • @Sachinkumar-is2ce
    @Sachinkumar-is2ce 2 роки тому

    💙💙

  • @NARUTOUZUMAKI-bk4nx
    @NARUTOUZUMAKI-bk4nx Рік тому

    💙💙

  • @BVaibhav-mt8jx
    @BVaibhav-mt8jx 3 роки тому

    💙

  • @aptitudepointiit-bhu5358
    @aptitudepointiit-bhu5358 2 роки тому

    💙💙

  • @sanket2866
    @sanket2866 3 роки тому

    💙

  • @prafullashukla9823
    @prafullashukla9823 2 роки тому

    💚💚

  • @techgamer1333
    @techgamer1333 2 роки тому

    💙💙

  • @chaitanyasampat7458
    @chaitanyasampat7458 3 роки тому

    💙

  • @mantra9006
    @mantra9006 2 роки тому

    💙

  • @educationeducation4889
    @educationeducation4889 2 роки тому

    💙

  • @aalsicoder2333
    @aalsicoder2333 2 роки тому

    💙

  • @tanayverma9458
    @tanayverma9458 2 роки тому

    💙

  • @AP_15m01
    @AP_15m01 2 роки тому

    💙

  • @chiraggoyal9646
    @chiraggoyal9646 2 роки тому

    💙

  • @surajshaw5880
    @surajshaw5880 2 роки тому

    💙💙💙

  • @sagarneware7247
    @sagarneware7247 2 роки тому

    💙

  • @mohilkapuriya1807
    @mohilkapuriya1807 2 роки тому

    💙

  • @vishalsiddha6637
    @vishalsiddha6637 2 роки тому

    💙

  • @ritikmandal7599
    @ritikmandal7599 2 роки тому

    💙💙💙

  • @primroseneog4302
    @primroseneog4302 2 роки тому

    💙

  • @sahilanand30
    @sahilanand30 2 роки тому +1

    💙