Implement Stack using Queues (LeetCode 225) | Using single and 2 queues | Visuals and animations

แชร์
ฝัง
  • เผยแพร่เมื่อ 31 ม.ค. 2025

ความคิดเห็น •

  • @aravinds6406
    @aravinds6406 11 หลายเดือนก่อน +14

    I wonder why your videos are not getting good views. Your way of explanation is awesome. Keep uploading more videos.

    • @nikoo28
      @nikoo28  11 หลายเดือนก่อน +4

      I will try my best

  • @democreation3594
    @democreation3594 6 หลายเดือนก่อน +2

    Your way of explaining and presentation is great bro. you deserve more views but small suggestion after you explain the code if you code along in leetcode it will be more easier for us to understand rather than seeing the final code so it might increase the views.

    • @nikoo28
      @nikoo28  6 หลายเดือนก่อน +1

      i do not plan on coding along in leetcode, there are a lot of youtubers who do the exact same thing.
      languages keep changing with time, so I would focus primarily on problem solving.
      You have so many chat GPTs available too which can write the code for you.

  • @sahelisohanitwins7492
    @sahelisohanitwins7492 10 หลายเดือนก่อน +1

    Nice explanation sir ❤

  • @jenniferfan8155
    @jenniferfan8155 10 หลายเดือนก่อน +1

    Very detailed explanation. Thank you

  • @PiyushYadav-pl9jm
    @PiyushYadav-pl9jm 7 หลายเดือนก่อน

    Best explanation ever!

  • @jagdishkhetre4515
    @jagdishkhetre4515 6 หลายเดือนก่อน

    Excellent explanation ... Thank you so much

  • @D.e.e.p.a.k_s.o.n.i_19
    @D.e.e.p.a.k_s.o.n.i_19 4 หลายเดือนก่อน

    sir u r too good never give up ur awesome

  • @Mydailymutualfundportfolio
    @Mydailymutualfundportfolio 3 หลายเดือนก่อน

    I cant thank you enough❤

  • @ignisharajathi334
    @ignisharajathi334 4 หลายเดือนก่อน

    Excellent explanation.Guddos

  • @limitless6189
    @limitless6189 8 หลายเดือนก่อน

    great explaination

  • @akashbestcode
    @akashbestcode 7 หลายเดือนก่อน

    amazing dude, I'm gonna subscribe you

  • @anveri867
    @anveri867 5 หลายเดือนก่อน

    When using a single queue we can make either push or pop efficient it doesn't have to be push only , so isn't it better we use a single queue or over 2 queues ?

  • @rudreshcm4172
    @rudreshcm4172 10 หลายเดือนก่อน

    Hey nickil which software tool you use for visualizations and any drawing pad?

    • @nikoo28
      @nikoo28  10 หลายเดือนก่อน

      That is GoodNotes 6

  • @prakhargarg4166
    @prakhargarg4166 11 หลายเดือนก่อน

    Best video

  • @VikashSingh-sf2xp
    @VikashSingh-sf2xp หลายเดือนก่อน

    Great

  • @sahilbait2981
    @sahilbait2981 6 หลายเดือนก่อน

    Best !!!

  • @karthik-varma-1579
    @karthik-varma-1579 11 หลายเดือนก่อน

    Sir Please Organise the playlist or videos with video no sir if I want to learn arrays in Java then I could find the video of main understand sir

    • @nikoo28
      @nikoo28  10 หลายเดือนก่อน

      have you checked the playlists on my channel?

  • @akhil7618
    @akhil7618 9 หลายเดือนก่อน

    Sir, I wanted to see the code for stack using 2 queues😢

    • @nikoo28
      @nikoo28  9 หลายเดือนก่อน

      Did you check the code provided in the video description?

    • @akhileshnandanwar7443
      @akhileshnandanwar7443 9 หลายเดือนก่อน

      sir there is no code of stack using 2 queues

    • @nikoo28
      @nikoo28  6 หลายเดือนก่อน +1

      class StackImplUsingQueues {
      Queue q1 = new LinkedList();
      Queue q2 = new LinkedList();
      public int pop() {
      if (q1.peek() == null) {
      System.out.println("The stack is empty, nothing to return");
      int i = 0;
      return i;
      } else {
      int pop = q1.remove();
      return pop;
      }
      }
      public void push(int data) {
      if (q1.peek() == null) {
      q1.add(data);
      } else {
      for (int i = q1.size(); i > 0; i--) {
      q2.add(q1.remove());
      }
      q1.add(data);
      for (int j = q2.size(); j > 0; j--) {
      q1.add(q2.remove());
      }
      }
      }

  • @engineermind1651
    @engineermind1651 6 หลายเดือนก่อน

    your way to explain theoritical is good but explain the code you more improve please.