Top "Big-o" questions

The Big-O notation is used to represent asymptotic upper bounds.

Solving the recurrence T(n) = T(n / 2) + O(1) using the Master Theorem?

I'm trying to solve a recurrence relation to find out the complexity of an algorithm using the Master Theorem and …

algorithm complexity-theory big-o recurrence master-theorem
Calculating the Recurrence Relation T(n)=T(n-1)+logn

We are to solve the recurrence relation through repeating substitution: T(n)=T(n-1)+logn I started the substitution and …

recursion big-o complexity-theory recurrence
Solving the recurrence T(n) = 2T(sqrt(n))

I would like to solve the following recurrence relation: T(n) = 2T(√n); I'm guessing that T(n) = O(log …

algorithm math big-o recurrence
Is there any general rule on SQL query complexity Vs performance?

1)Are SQL query execution times O(n) compared to the number of joins, if indexes are not used? If not, …

sql performance big-o
O(nlogn) Algorithm - Find three evenly spaced ones within binary string

I had this question on an Algorithms test yesterday, and I can't figure out the answer. It is driving me …

algorithm big-o
What is the runtime complexity of a switch statement?

I'd like to know what the worst-case runtime complexity of a switch statement is, assuming you have n cases. I …

algorithm programming-languages switch-statement big-o
Quicksort superiority over Heap Sort

Heap Sort has a worst case complexity of O(nlogn) while Quicksort has O(n^2). But emperical evidences say quicksort …

algorithm sorting big-o quicksort heapsort
What is the Best/Worst/Average Case Big-O Runtime of a Trie Data Structure?

What is the best/worst/average case complexity (in Big-O notation) of a trie data structure for insertion and search? …

data-structures runtime big-o trie
Why is accessing an element of a dictionary by key O(1) even though the hash function may not be O(1)?

I see how you can access your collection by key. However, the hash function itself has a lot of operations …

c# dictionary hashtable big-o
Why is the constant always dropped from big O analysis?

I'm trying to understand a particular aspect of Big O analysis in the context of running programs on a PC. …

algorithm big-o analysis