next greater element (use of stack)

Поделиться
HTML-код
  • Опубликовано: 9 окт 2024
  • Find NEXT GREATER ELEMENT for each element in the array by using Stack. The time complexity is less than O(n^2).

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

  • @NeoStreamLive
    @NeoStreamLive 6 лет назад +54

    kya samjhaya hai bhai,, maza a gaya ek hi baar me, geeksforgeek ne to bheja fry kar diya tha

  • @Official-tk3nc
    @Official-tk3nc 4 года назад +54

    if you are watching this in lockdown believe me you are one of the rare species on the earth who is working hard to achieve something in life. Many students are wasting their time watching movies, playing pubg, watching netflix , etc, ALL THE BEST nitjstudenthere

    • @akshatjindal9112
      @akshatjindal9112 4 года назад

      which branch
      me also from nitj

    • @Official-tk3nc
      @Official-tk3nc 4 года назад

      @@akshatjindal9112buddy nitj means jalandhar not jaipur or jamshedpur....... by the way i am cse 2nd year

    • @akshatjindal9112
      @akshatjindal9112 4 года назад

      @@Official-tk3nc yaa.. I m also from nit jalandhar

    • @Official-tk3nc
      @Official-tk3nc 4 года назад +1

      @@akshatjindal9112 which year bro?and which branch?

    • @akshatjindal9112
      @akshatjindal9112 4 года назад +1

      @@Official-tk3nc 1st year.. EE branch

  • @spk9434
    @spk9434 4 года назад +11

    Excellent walk thru of the solution. The gist: We are using a stack to store all the elements for which nextGreaterValue is yet to be found. When we find such element pop the stack.

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

      as simple as that. thanks for summing up

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

      Plz give me the code I'm facing some problem

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

    Great Explanation! Very easy to understand as compared to Leetcode. Thank you

  • @arunshetty4192
    @arunshetty4192 6 лет назад +4

    Hi Vivekanand,
    Great videos.Can you please make video on Stock Span problem and Celebrity problem.Thanks a ton !!!

  • @AbhinavKumar-dr4ef
    @AbhinavKumar-dr4ef 2 года назад

    Easy and clear explanation. Thank you.

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

    Holy crap thank you random dude on RUclips, you helped me to make to to Faang

  • @hassamsheikh
    @hassamsheikh 6 лет назад +1

    Understanding the algorithm and implementing it seems a good coding practice. Good work,

  • @triparnabhattacharya5284
    @triparnabhattacharya5284 5 лет назад +2

    Great video! Can you please provide the link to the code as well, it will be very helpful.

  • @ratheevlogs5113
    @ratheevlogs5113 7 лет назад +5

    I like your tutorial but Please explain code with the help of Algorithm.

  • @srinidhiii
    @srinidhiii 6 лет назад

    why no more video's from you sir? please try to do video's when you find the time.It very usefull

  • @sidddddddoo7
    @sidddddddoo7 7 лет назад +1

    I am glad I found ur channel....Very helpful

  • @anjana1700
    @anjana1700 5 лет назад +1

    Thanks sir for an awesome explanation. Sir please explain stock span problem. Thank you in advance:)

  • @zhounina6206
    @zhounina6206 4 года назад

    I really enjoy your lesson, thanks so much

  • @hassamsheikh
    @hassamsheikh 6 лет назад +6

    When you dead inside but still likes to make algorithm videos

  • @SarbbottamBandyopadhyay
    @SarbbottamBandyopadhyay 5 лет назад +2

    Great explanation! Thank you!

  • @tridevthakur5397
    @tridevthakur5397 4 года назад

    💢💢💢Superb explaination by u sir💢💢💢

  • @a_l_o_k_1991
    @a_l_o_k_1991 4 года назад

    Sir graph k intrview question k solution batao?

  • @me_amir982
    @me_amir982 6 лет назад +6

    make a video on STOCK SPAN PROBLEM plzzzz

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

    Great Explanation! Thanks

  • @halojustin01234567
    @halojustin01234567 6 лет назад +2

    Thanks! Best video of this question on yt!

  • @donyu4426
    @donyu4426 6 лет назад

    very clear, nice video. thanks a lot.

  • @Sushil2874
    @Sushil2874 5 лет назад

    Very well explained ..!!
    Thanks..!!

  • @AbandonedAccNOW
    @AbandonedAccNOW 7 лет назад +1

    Thank you so much,your video was really helpful. :)

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

    nice explaination sir

  • @ashishsinha8893
    @ashishsinha8893 7 лет назад

    bro upload lectures of algorithm only because in RUclips there is less no. of channel which provide algorithm videos I think it will be successful...

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

    Great Explanation

  • @ridamsharma1869
    @ridamsharma1869 6 лет назад

    plssss upload the video of conversions of infix prefix postfix

  • @prashantshukla7203
    @prashantshukla7203 7 лет назад

    superb sir!!! very helpful lecture

  • @kartikagarwal5414
    @kartikagarwal5414 4 года назад

    great explanation sir
    thanku

  • @ishanmadhav766
    @ishanmadhav766 4 года назад +1

    People, do not learn this one from Geeksforgeeks. They have messed up and made it confusing and somewhat wrong. Learn it from here and implement it yourself.

  • @yuantongyu9107
    @yuantongyu9107 4 года назад +1

    Got asked this question in an interview.

  • @pavithraradhakrishnan8229
    @pavithraradhakrishnan8229 4 года назад +1

    Million thanksssss

  • @aalaprawat4742
    @aalaprawat4742 4 года назад

    nice explaination

  • @leony7451
    @leony7451 6 лет назад +1

    great vid!!

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

    thank you alot

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

    awsm

  • @prabhleenkaur5267
    @prabhleenkaur5267 4 года назад

    can anyone please share the code for this ques in cpp

  • @shauryapratapsingh5440
    @shauryapratapsingh5440 7 лет назад

    very useful stuff..!

  • @algorithmsguide5076
    @algorithmsguide5076 4 года назад

    Thank you !!

  • @Joyddep
    @Joyddep 5 лет назад

    Great Explanation!

  • @abhishekshukla5484
    @abhishekshukla5484 5 лет назад

    Thank You Sir

  • @reyou7
    @reyou7 5 лет назад

    thanks man!

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

    Use sorting man

  • @AddieInGermany
    @AddieInGermany 7 лет назад

    Thanks :)

  • @Bakepichai
    @Bakepichai 6 лет назад

    The C++ code can be found here - ide.geeksforgeeks.org/RLQ8VHPdgz

  • @rohanshishuahi7156
    @rohanshishuahi7156 4 года назад

    Hi