Sort an array of 0s, 1s and 2s GeeksforGeeks || Adobe Amazon Microsoft Coding Question || Easy

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 พ.ย. 2024

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

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

    Very very nice explanation. I saw many videos but not clear. Your explanation was just crisp and neat👌. Can you pls solve all the grind 75 list questions.

  • @Wolverine_261
    @Wolverine_261 2 หลายเดือนก่อน +1

    Simply count the frequencies in one iteration and then refill array using these frequencies in another iteration?

  • @ashutoshbehera7145
    @ashutoshbehera7145 2 หลายเดือนก่อน

    good explanation. thank you very much

  • @bhimeshyadav7406
    @bhimeshyadav7406 ปีที่แล้ว

    The explanation was amazing..keep doing 👍

  • @UCSAkhilPrasad
    @UCSAkhilPrasad ปีที่แล้ว

    Explanation is superb but kindly use the mic in future for better voice quality

  • @newera4225
    @newera4225 2 ปีที่แล้ว

    The explanation was quite clear....thank you :)

  • @ashwinnair1035
    @ashwinnair1035 ปีที่แล้ว

    wow.... great explanation

  • @BrijeshKumarchb
    @BrijeshKumarchb ปีที่แล้ว

    wow awesome

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

    Funfact is that if you just write sort(a,a+n), it will work although it is using nlogn but all test cases will be passed

    • @ASHUTOSHSHARMA-h4w
      @ASHUTOSHSHARMA-h4w 5 หลายเดือนก่อน

      Likha toh hai O(n) hona chahiye time complexity. O(nlogn) ka achaar dalega kya?

  • @krishanusantrakrish8478
    @krishanusantrakrish8478 ปีที่แล้ว

    Ma'am. 29 line where you write else if(a[mid==2]) // else if(a[mid]==2) which is right answer?

  • @itz_me_imraan02
    @itz_me_imraan02 2 ปีที่แล้ว

    Great explanation💓....

  • @Greatfulone
    @Greatfulone 3 ปีที่แล้ว

    Thank you so much. Helped out a lot.

  • @Code_express
    @Code_express ปีที่แล้ว

    thank you mam

  • @rajdutta5149
    @rajdutta5149 2 ปีที่แล้ว

    Nice session Alisha.

    • @rajdutta5149
      @rajdutta5149 2 ปีที่แล้ว +1

      Hey Alisha, are you still pursuing data structures and algorithms, If yes can we do pair problem solving.
      Please let me know your point of view on the below :-
      Cause most probably it's better to get pair problem solver instead of solo problem solver.rd
      Also I found your problem solving techniques and your thought process over problems is good,
      So, I thought if you can share some experience.
      Please let me know if you have any queries.
      Thanks and Regards,
      Raj

    • @omautade5490
      @omautade5490 2 ปีที่แล้ว

      @@rajdutta5149 lol

  • @pratikkinare903
    @pratikkinare903 2 ปีที่แล้ว

    Thank you!!!

  • @learncseasily3385
    @learncseasily3385 ปีที่แล้ว

    Why sort(a,a+n) doesn't work

  • @AbhishekVerma-dv6bz
    @AbhishekVerma-dv6bz 2 ปีที่แล้ว

    Thanks Bro

  • @aldoalf
    @aldoalf ปีที่แล้ว +1

    Why don't just count the number of 0, 1, 2s, an then override the values of the array?

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

      because it takes O(2N), while this approach, also known as Dutch National Flag Algorithm, takes only O(N) time, although both are considered, although its not much of a difference, O(N) is still faster than O(2N).

  • @priyankakumari-oy6vu
    @priyankakumari-oy6vu 2 ปีที่แล้ว +1

    Im getting time limit exceeded

  • @AashiqueHussain_
    @AashiqueHussain_ 2 ปีที่แล้ว +1

    improve voice quality