Leetcode 973 - K Closest Points To Origin (JAVA Solution Explained!)

Поділитися
Вставка
  • Опубліковано 19 вер 2024
  • Leetcode 973 - K Closest Points To Origin (JAVA Solution Explained!)
    If you like this video, please 'Like' or 'Subscribe'. This is really helpful for my channel and also motivates me to do more. Stay tuned!

КОМЕНТАРІ • 6

  • @LCBear
    @LCBear  3 роки тому +1

    In case you wonder, at the end of line 6, there is an extra semicolon. Please delete the semicolon and it will be passing.

  • @Zach-cv4gu
    @Zach-cv4gu 2 роки тому +1

    What would be the space complexity ?

  • @Zach-cv4gu
    @Zach-cv4gu 2 роки тому +1

    Quick question what would the space complexity ?

    • @LCBear
      @LCBear  2 роки тому

      Just N. to be exact just original input plus k.

  • @fredyrocky
    @fredyrocky 3 роки тому +1

    what is the time complexity, isn't Quick Select a better alternative for time complexity?

    • @LCBear
      @LCBear  3 роки тому

      Quick select is good and it is O(n) Depend on the mid point selection.
      PQ is N*LogK, k is the size of the heap