Heap - 3: Find Kth Largest Value in given array | Using Min Heap | Using Max Heap

Поделиться
HTML-код
  • Опубликовано: 27 окт 2024

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

  • @surajgrandhi6742
    @surajgrandhi6742 4 года назад +8

    I wish i would have found this channel at starting of lockdown. If so i will become a good programmer .
    Can u please tell me some tips I have only 15 days left for my placements. I have to get good programming skills & good job

    • @CodingSimplified
      @CodingSimplified  4 года назад +3

      Thanks Suraj for your nice feedback. If you've less time, I would say just solve important questions from each topic. Especially array, string, binary tree. Mainly questions are asked from these topics in interviews.

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

      Thank you, Learning a lot from ur videos,
      Mainly knowing new techniques

  • @Sujith0369
    @Sujith0369 4 года назад +7

    The Best Channel i have seen till date on java Great Explaination Sir keep going and thanks for the content especially for max heap as it is not direct function in java

  • @ghostslinger3148
    @ghostslinger3148 3 года назад +2

    Best tutorial I've found so far! Great video!
    Regarding the max heap and min heap.
    max heap: complexity O(N) + k Log N
    min heap: complexity k log k + (N-K) log k
    which one is faster?
    i assume k log k should be faster than O(N) if k is a small number
    and k log N should be faster than N log k, am I right?

  • @reshmah1497
    @reshmah1497 3 года назад +1

    BEST explanation,thanks....This problem is of what level in interview? Easy/medium/hard?

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

    best series of heap on youtbe

  • @jatinchoubey6053
    @jatinchoubey6053 Год назад

    one thing i can not digest is, why you need to traverse 'k' times after sorting in order to find the kth largest element. Isnt the element already at kth index ? @1:37

    • @lukebarry1417
      @lukebarry1417 11 месяцев назад

      You're correct. It is O(NLogN) plus constant time for single array access, so O(NLogN)

  • @bhaskar1210
    @bhaskar1210 4 года назад +3

    if the input array has duplicates this will not work.
    example : {3,2,3,1,2,4,5,5}.
    I feel like we have to add duplicate condition while adding the element to the Heap

  • @ananthasubramanian7355
    @ananthasubramanian7355 3 года назад +1

    Good explanation...Thank you...!!

  • @ranjitasahu19
    @ranjitasahu19 4 месяца назад

    Thank you so much

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

    best explaination ever

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

    it will be more better if you paste the leetcode link of question also bro and thanks

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

    I Have A Doubt In Clavax Technologies Code Question Explain Next Time.

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

    Nice explanation bro🧡🧡

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

    sir in implementation of max heap i am getting error in the Collections.reverseOrder(). But if i remove the Collection.reverseOrder() there is no error would u explain?

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

      Java 8 onwards, PriorityQueue's Comparator uses lambda expressions, right? Is that the reason why? Not sure.

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

    How is creating a max heap O(N) and not O(NlogN) but creating a min heap is O(klogk)?

  • @sujithgoud3535
    @sujithgoud3535 3 года назад +1

    Ty sir

  • @yatri6329
    @yatri6329 2 года назад +1

    3Rd video dekh rha hu ab.