big o Flashcards
QUICK SORT
worst case time complexity?
worst case space complexity?
time - O(n^2)
space - O(log(n))
MERGE SORT
worst case time complexity?
worst case space complexity?
time - O(n log(n))
space - O(n)
BUBBLE SORT
worst case time complexity?
worst case space complexity?
time - O(n^2)
space - O(1)
INSERTION SORT
worst case time complexity?
worst case space complexity?
time - O(n^2)
space - O(1)
SELECTION SORT
worst case time complexity?
worst case space complexity?
time - O(n^2)
space - O(1)
LINEAR SEARCH
worst case time complexity?
time - O(n)
BINARY SEARCH
worst case time complexity?
time - O(log(n))
what is the relationship between input size and execution time for O(1)?
always executes in the same time regardless of the size of the data set
what is the relationship between input size and execution time for O(log(n))?
execution time increase is linear when input size is doubled
what is the relationship between input size and execution time for O(n)?
execution time is proportional to the input size increase
what is the relationship between input size and execution time for O(n^x)?
execution time increases relating to the highest degree of the polynomial complexity as the input size increases
what is the relationship between input size and execution time for O(2^n)?
execution time increases exponentially as the input size increases
what is the relationship between input size and execution time for O(n!)?
execution time increases in a factorial nature related to the input size
what is the worst time complexity described by big O notation?
O(n!) or factorial time complexity
what is the best time complexity described by big O notation?
O(1) or constant time complexity