HomeToolsAbout

Array

Concepts

When an input is an array, clarification whether the array is a sorted or unsorted is a critically important time complexity assumption to question/clear.

Time Complexity

Optimal Sorting

Merge sort has Big O = Big Omega = Big Theta of O(n log n).

Sum of All Comparison

Sum of all comparison (n-1) + (n-2) + (n-3) + …+1 is n*(n-1)/2.

  • This would translate to a time complexity of O(n^2).
AboutContact