Array - 44: Find Missing Number in 1 to n+1 numbers range

Поділитися
Вставка
  • Опубліковано 2 лют 2025

КОМЕНТАРІ • 7

  • @rahulsinghai3033
    @rahulsinghai3033 4 роки тому +1

    Find the closest number in array consisting of positive and negative number. Ex -4,-1,0,2,4,10and target 30 output 10 ... If possible

    • @CodingSimplified
      @CodingSimplified  4 роки тому

      Ok, I'll try to do it. It can be implemented using Heap. We can find upto k closest. In your case k = 1. Will try to add this video soon.

    • @rahulsinghai3033
      @rahulsinghai3033 4 роки тому

      @@CodingSimplified Yes ,it can be solved using binary search . Want to understand multiple approaches

  • @ashutoshshukla5253
    @ashutoshshukla5253 4 роки тому +1

    good explanation keep uploading new videos...

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

    Each and every video the explanation is very good. But I'm getting confusion about time and space complexity. for question no.(44-46), as per my understanding time complexity is O(n2)-(2 loops). I'm confused because it is O(n).I want to get a clear understanding of "Time& Space complexity". Please address my doubt

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

    1. Could you please explain why Arrays program no.44's time complexity is O(n) and why not it is O(n2) because it is having 2 loops?
    2. When time complexity is the same for the below 2 programs, what is the better approach and why?
    Arrays 44: ua-cam.com/video/Ye87Z472M3k/v-deo.html
    Arrays 11: ua-cam.com/video/9al_CQEksVA/v-deo.html