Skip to content

Instantly share code, notes, and snippets.

@prabuinet
Created September 3, 2019 09:31
Show Gist options
  • Select an option

  • Save prabuinet/68c2c89c5527dff7366261adc52658bb to your computer and use it in GitHub Desktop.

Select an option

Save prabuinet/68c2c89c5527dff7366261adc52658bb to your computer and use it in GitHub Desktop.
Quick sort have worst-case complexity of O(N^2). The Array Size for the third testcase is 10^5.
So, it's producing an O(10^10) Complexity. In 1 second only 10^8 instructions can pass. Hence, it's giving a TLE.
Use the inbuilt Sort function in C++/Java/Python. It's optimised enough for most problems.
by Shantanu Sinha - hackerearth/codemonk/binarysearch comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment