Skip to content

Instantly share code, notes, and snippets.

@Trevahok
Last active July 25, 2020 11:44
Show Gist options
  • Save Trevahok/9e15f017c1769a87b1ff48720712e214 to your computer and use it in GitHub Desktop.
Save Trevahok/9e15f017c1769a87b1ff48720712e214 to your computer and use it in GitHub Desktop.
STL function Time Complexity Space complexity
sort() O(nlogn)  O(1)
lower_bound()  O( logn) O(1)
upper_bound()  O(logn) O(1)
next_permutation() O(n)  O(1) 
prev_permutation() O(n) O(1)
partial_sort( , k ) O(n +klogk) O(1)
nth_element() O(n) O(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment