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

  • @AARVINDHBEE
    @AARVINDHBEE 3 года назад +28

    Your solution is O(N + M) but in question they what O(log(N+M))

    • @Techsithtube
      @Techsithtube 3 года назад +5

      I will create another video for lo(n+n) I was going to do it but then I thought lot of people need bit more linear way.

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

      It would be great if you make a video on Heap data structure.
      Please it's a request.

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

      @@Techsithtube yes your solution is easy for beginners, thank you upload more videos

  • @ankitsoni3388
    @ankitsoni3388 3 года назад +10

    But as per the question, space complexity required was o(log(m+n)) but you did it in o(m+n)

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

      I am going to create another video to cover o(log(m+n) ) the video was bit longer so I am going to split into two.

  • @vidhyalongani6521
    @vidhyalongani6521 3 года назад +13

    Hey.. I landed an offer for a Senior Frontend Developer position last week.. All thanks to your super useful videos.. thanks a ton.. U keep going n i wish u reach great heights

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

      Great. Congratulations! I wish you best luck on your new endeavor. keep on learning!

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

    new technique I learned...thanks :)

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

    Great vid!

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

    Love your explanation technique...

  • @techbhupi9398
    @techbhupi9398 3 года назад +5

    Please don't stop ... just continue this series as long as possible & I will keep commenting ,like & share ON.THANX A TON SIR

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

      Don't worry! I will keep making such videos. Thanks for watching!

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

    I looked your code and the complexity of the merged approach is also O(Max(M,N)), not log(m+n)

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

    Really nice explanation .... Keep sharing knowledge with us...👍

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

      I will try my best

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

      @@Techsithtube is the second solution provided not O(m+n) ? I think u shud also provide explanation on time complexity.

  • @RajwinderKaur-po2qd
    @RajwinderKaur-po2qd 3 года назад

    Thanks... really helpful

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

    Nice

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

    tbh, you only need to while i+j

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

      thanks for the input. I was thinking about that but , lot of the audience is new to algo so for them I thought of giving little bit clarity. I am in the process of making the video for O(log(m+n)) and space complexity O(1) . Will release that next.

  • @6b14yeungsinchun-8
    @6b14yeungsinchun-8 3 года назад +4

    Merging takes O(m + n)... log (n + m) is a lot harder than this...

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

      I will create another video for lo(n+n) I was going to do it but then I thought lot of people need bit more linear way.

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

      @@Techsithtube figure it out yet?

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

    are you only gonna cover the frequent questions?

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

    At 8:31 shouldn't his return statement be totalArray.length%2, not totalArray%2, because we want to see if the array length is odd or even for the ternary operator? I'm not a high level coder by any means, i need confirmation cause I keep getting a different answer other than 2.5. Thank You in ADV.

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

      You are right. I think I made a mistake in hurry. it should be totalArray.length%2. I am surprised that you are the first one to point this out. Thank you!

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

    Sir.. Do u have another channel..in the name of InterviewNest??

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

    Sir, I'm not sure why the multiple 'while' loop approach? The first one - the Brute force one - felt far more easier and it's so much more easier with JS.

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

      You can also do it in one loop however for a video like this its easier to show whats going on in two multiple loops. I think complexity remain the same , its just code is bit more readable for novice.

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

      Got it! Thanks for the reply.

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

    Thanks :) for your efforts for providing such type of easily understandable content. I go through a lot of content on RUclips but my finding get completed when I found your channel. In my life all the front-end knowledge and all the interviews which I cleared was because of your efforts.
    Thanks a lot!!!
    keep going (y) ...Best Wishes!!!

  • @aman.tyagi112
    @aman.tyagi112 3 года назад

    ❤️❤️❤️❤️❤️❤️❤️

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

    last time i was this early you teached react

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

      I am also planning for making more react videos. this is in plans. Thanks for watching!

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

      @@Techsithtube but continued to coding as well, I request you

  • @0lgatron
    @0lgatron 2 года назад

    The brute force method has an error -> it's supposed to be :
    return middle % 2 !== 0
    ? (totalArray[middle] + totalArray[middle -1]) / 2
    : totalArray[middle]

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

    I just started on js and found your channel. It really helps thanks a ton. 👍🏻

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

    Please share more leetcode problem

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

      Himanshu, my plan is to make more such videos. thanks.

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

      @@Techsithtube please try to upload at least one leetcode problem in a week.

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

      @techsith please upload more leetcode problem

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

    Hi Sir, Please provide more solutions in javascript, it's really helpful

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

    The solution is not correct in terms of time complexity. In video it is O(m+n), whereas task requires O(log(m+n))

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

    If I understand it correctly You do not have to merged full m+n length array. You just have to determined what is on floor((m+n)/2) position and return it value (or for even length return (floor((m+n)/2)+floor((m+n+1)/2))/2) )

  •  3 года назад +5

    2+4/2 is not 3. You're missing parenthesis.

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

      its not part of the code. I was just explaining the logic . So didnt have to make it perfect. :)

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

    This is not the leetcode solution because its asking to solve with O(log(m+n)), not O(m+n). Sorry, but you got incorrect answer.

  • @1084kmp
    @1084kmp 2 года назад

    How is this an O(log(m+n)) solution? Instead this is a O(m+n) solution! You will have to find the median of the 2 arrays without creating a single sorted array in order to achieve O(log(m+n))

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

    Completed Waste my time watching O(N + M) solution