Everything about C++ STL MAPS - Part 1 | Competitive Programming Course | Episode 25

Поділитися
Вставка
  • Опубліковано 10 чер 2024
  • C++ STL TUTORIALS : • C++ STL | Competitive ...
    FREE COMPETITIVE PROGRAMMING COURSE TUTORIALS : • Competitive Programmin...
    FOR DOUBTS AND DISCUSSIONS, JOIN DISCORD : / discord
    This video is part 1 of C++ STL MAPS. In part 1, I discuss in detail about maps, their functions, how to use them and this video due to time restriction I only discuss normal maps and next part I will discuss Unordered maps and a basic Introduction to Multimaps as well.
    Practice Questions:
    Note: Its hard to find practice questions particularly for STL as they are generally used with other concepts involved hence not providing a lot of them in STL videos. Below are some questions for practice:
    practice.geeksforgeeks.org/pr...
    codeforces.com/problemset/pro...
    codeforces.com/problemset/pro...
    www.hackerrank.com/challenges...
    www.geeksforgeeks.org/tag/cpp...
    Timestamps:
    Basics of Map : (0:00)
    Basic code of Map : (3:44)
    Find And Erase : (11:59)
    Time complexity dependency on keys: (16:45)
    Question on Map : (19:10)
    Be a part of our awesome Community. Join
    ○ Discord : / discord
    ○ Telegram : t.me/LuvIsMeYT
    You can follow me on below platforms for all the latest updates
    ○ Instagram : / i._m_.luv
    ○ Twitter : / luvk1412
    ○ Linkedin : / luvk1412
    Blog(Not frequently updated)
    ○ Blog : www.codewithluv.in
    Hashtags
    #maps #unordered #stl #tutorial #competitivecoding

КОМЕНТАРІ • 349

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

    Hi everyone there is a little correction at 11:40, I said that loop is O(NLogN) but it O(N).
    Explanation : Accessing values through iterator is a O(1) operation as iterator has address of the value and access value at some address if you know the address is a unit time operation. Now when we traverse the map, we start from m.begin() and are doing it++ in each step, it++ is also O(1) , so whole map traversal is O(1) only. at 11:40 we are not using iterators but internally that only is happening, pr is the value at address pointer by iterator, internally range based loops is also iterating through maps using iterators and then providing us reference to to the value at that address.
    But when you want to directly access some specific value in map using m[key] or m.find(key), these are log(n) operations as log(n)time is taken by map to search this key.

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

      but bhiya as you explained in the previous video, here 'pr' will identify its datatype througn 'm' as .Then how come 'pr' becomes an iterator?
      (or) are you saying it as iterator because you used 'pr' as reference ?
      (or) are you saying the variable in range based loops is always an iterator?
      please explain bhiya.
      thank u :-)

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

      @@vk6297 variable in range based loops is always the value, neither a pointer nor an iterator

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

      one correction for n elements map traversal will be O(n) as stated by you in first line but in the explanation you wrote ,so whole map traversal is O(1) only

    • @harsh.sharma
      @harsh.sharma 2 роки тому +1

      Got ya point bhaiya 👍

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

      @@pranavsharma7479 same doubt

  • @adityaramakrishnan969
    @adityaramakrishnan969 3 роки тому +228

    Tbh u r the first youtuber whose cpp lectures are really understandable

  • @TheGeekyExplorer
    @TheGeekyExplorer 2 роки тому +6

    Really this is one of the most underrated channel in UA-cam. Hats off to you for providing detailed videos on such important concepts like these. Please continue making videos on such topics.

  • @VC-dm7jp
    @VC-dm7jp 2 роки тому +8

    Just want to thank you for such a beautifully explained video, always had a problem with handling maps but now, it's all crystal clear. Again, thank you

  • @abhishekhorton79
    @abhishekhorton79 3 роки тому +39

    bro your playlist is amazing I never felt that much motivated yet but after this I'm solving some good questions please complete this course for students like me it's very helpful for real thanks a lot.

  • @harshitsingh4764
    @harshitsingh4764 3 роки тому +19

    I visited this channel first time, and i am very much impressed by the ease with which luv teaches.👌🏻

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

    thanks man, you made everything easy, one of the best explainations on yt

  • @HimanshuKumar-jw5sw
    @HimanshuKumar-jw5sw 10 місяців тому

    I visited this channel first time, and i am very much impressed by the ease with which luv teaches

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

    I have watched many tutorial in youtube ,,but i havenot seen anyone to teach like this,,very helpful..

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

    Great work bro, this video gave me some pointers that i didn't knew about even after reading articles on maps from gfg and other sources. Thank you for you efforts.

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

    buddy you nailed it.. big tym .. i aint gonna miss any of ur content from nw on .. cheers to ur hard work mate :)

  • @omkarnaik9217
    @omkarnaik9217 Рік тому +6

    The transition at 23:50 was so smooth ^^

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

    Your teaching style is really impressive. Thanks a lot bro for all your hard work.

  • @DhruvSharma-mh5vf
    @DhruvSharma-mh5vf 2 роки тому +1

    I have seen so many cpp playlists until now but yours is just on another level.....very easy to understand...thank you so much for such valueable resource brother 🌸🛐

  • @AgnivaBanerjee6
    @AgnivaBanerjee6 3 роки тому +11

    Things learnt.
    //Everything about C++ STL MAPS - Part 1 | Competitive Programming Course | Episode 25
    #include
    using namespace std;
    #define pb push_back
    #define f first
    #define s second
    #define REP(i, a, b) for (int i=a; i

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

      Thnx bro

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

      how m[s]++ increases count of second

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

      @@citrus5127 its just increment(increases by 1) the value of respective string

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

      @@xd9050 it is but how when we don't give m[s] then empty string

  • @himanibisht9300
    @himanibisht9300 3 роки тому +6

    You explain so well and amazing . Thanks, Bro.

  • @AnisurRahman-dg6jm
    @AnisurRahman-dg6jm Рік тому +2

    I stuck map in the last few months, But this video really help me. Your approach is very unique and helpful for all. Thank You

  • @XYZ-353
    @XYZ-353 11 місяців тому

    You are making my programming journey much more easier. Take love&respect from Bangladesh.💚

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

    Straight to the point and understandable !

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

    what a amazing explanation and the whole playlist..... thank you so much

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

    Problems in the description has, cleared all my thinking ability towards the maps, thank you luv sir

  • @gyanabrota
    @gyanabrota 3 роки тому +40

    Your efforts are really commendable ❤️

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

    Thanks for this awesome LECTURE. You are the best teacher on yt sir :)

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

    You are Awesome, sir..
    God bless you...
    from🇧🇩

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

    Carry on! We are with you.

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

    You cover complicate topic very easily and solve all doubts

  • @Dineshkumar-uz4dw
    @Dineshkumar-uz4dw 3 роки тому +7

    Hey luv bro, thanks for your stl series, it's really simple to understand.

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

      STL series is part of the full competitive series, link to full playlist is in description.

  • @codedByAyush
    @codedByAyush 2 місяці тому

    Bhaiya, sach me bahut acha explain karte ho, app!

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

    Love u bhyya thank you baki sb, Sirf view and subscriber ke liye krte hai bt aap *why when and how to use it* btate hai

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

    thanks, bhiya . your videos are too great . you are putting great efforts for us thanks for this . your explanation is far better than paid courses . 👌

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

    Nobody explain c++ better than Luv bhaiya, Thank you so much bhaiya for giving ur tym nd for this wonder ful playlist🙏🙏

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

    awesome simple and understandable for everyone

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

    Boht badiya samjhaya hai Excellent bhai

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

    Loving your explanation. :)

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

    Thank u! These videos are on another level💖

  • @AbhishekSharma-bd3pu
    @AbhishekSharma-bd3pu Рік тому

    your videos are really very helpful for me to understand the concepts . Thank you for your hardwork which makes it easy too understand .
    please add more videos releated to compatative programming .

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

    Brilliant bhai, thank Q and love You brother from India !!!

  • @akankshyabarua2477
    @akankshyabarua2477 2 роки тому +5

    this was really helpful and you legit did a great job explaining it, thanks

  • @Alpha_Monk3
    @Alpha_Monk3 2 місяці тому

    easy to understand ,thankyou❤

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

    really appreciate the content bro
    thanks for amazing explaination

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

    Thank you sir !! awesome explanation.👍👍

  • @happyteen7195
    @happyteen7195 10 місяців тому

    whata amazing transition in the end

  • @sonukumarnirala6896
    @sonukumarnirala6896 2 місяці тому +1

    Your Hard Work in making Video is benificial for us. Thanks a lot Gurujii

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

    Really bro . Your teaching skills are extraordinary . Keep uploading the videos. It would be really helpful if you would make similar kind of videos on hard topics like dynamic programming or backtracking.

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

    great explanation!! thanks a lot sir!

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

    You made it so easy to understand

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

    Thanks luv for making these concepts so easy. Best part is you dont make videos too long and edit properly. Good waork bhai.

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

    your lectures help me very much.. thanks 🙏🏻

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

    Ahh...I found this and it is really good. Thanks luv :)

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

    i just undersTAND A THING THAT I JUST NEED TO FOLLOW YOU BLINDLY FOR CC

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

    you are just great .just keep making more and more and more...........................

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

    Amazing content..what else do u need?
    I'm lovin it....!

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

    Thank you Bhaiya 🙏🙏🙏♥️😊

  • @Vishal-joshi1998
    @Vishal-joshi1998 3 роки тому +2

    this video helps me to solve Raman to Int problem

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

    Really helpful course! 🔥

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

    This is a really amazing stl series 🤟

  • @AbhishekJain-pm2jn
    @AbhishekJain-pm2jn 2 роки тому +1

    Thanks bhai itne acche explanation ke liye

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

    Thanks a lot bro👍.Amazing explanation.

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

    Very nice explanation...thanku

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

    Great content, thank you very much

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

    yaar bhut acha samjhaya thanks bro

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

    Everytime luv Bhaiya is just amazing.

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

    So nicely explained 😀.

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

    Problem set is as amazing as video.

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

    Bhai you are awesome .Keep up the good work🤗🤗

  • @RavinderSingh-ew2sl
    @RavinderSingh-ew2sl 2 роки тому

    Awesome Explaination

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

    You are really awesome....
    Thank you...❤️

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

    You have done great work bro thank you👌

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

    very nice bro really enjoyed the whole video ...❤❤

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

    Thank you sir🙏

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

    Pretty underrated !

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

    Thank you ❤️

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

    Great Explaination

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

    great job bhaiya!!

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

    Bro you are an inspiration.

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

    THANKS A LOT BHAIYA .YOUR VIDEOS ARE LIKE AWESOME

  • @ANUJKUMAR-wc9dz
    @ANUJKUMAR-wc9dz 9 місяців тому +1

    for earse funciton if we passing the iterator than time complexity of earser function is going to be O(1)

  • @PrinceKumar-zs5uf
    @PrinceKumar-zs5uf 2 роки тому

    Awesome videos , Thank you Luv bhaiya

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

      Bro would you consider watching my video on maps and unordered maps

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

    Sir, At least ek week me 4 videos bnaya kro, agar possible ho to.
    Bhut help milta h videos se.

    • @coefficient1359
      @coefficient1359 3 роки тому +6

      He is already doing a great effort.

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

      nhi hai possible

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

    awesome luv bro.

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

    thanks and liked the animation in the end.

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

    VEry well explained ❤❤

  • @Nitro-kx7ok
    @Nitro-kx7ok Рік тому

    Understood sir ❤🙏🙇‍♂

  • @0gravity519
    @0gravity519 2 роки тому

    u r GEM !

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

    Good explanation😇

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

    This is the most underrated channel for CP and DSA .....😑

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

    Thank You

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

    Thank you bhaiya

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

    Thank you!

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

    Salam hai Bhai tumko.

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

    Thanks sir ❤️

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

    very nice !

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

    These videos are 💓

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

    thanku brother

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

    Thanks❣️

  • @RohitKumar-po5qt
    @RohitKumar-po5qt 3 роки тому +4

    I am even ready to pay for this content , awesoooooome !!!!!!

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

    bro you make everything so easy to understand, tysm 💟

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

    good video, very helpful

  • @Amit-fn7bw
    @Amit-fn7bw 2 роки тому

    bhaiya, I really like your videos

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

    best explanation