Complexity - Algorithm running time
7 important questions on Complexity - Algorithm running time
On what [4] things does algorithm running time depend?
- Problem size/input size;
- The algorithm used;
- Software compiler;
- Computer;
What are [2] assumptions in calculation of algorithm running times?
- Each number requires one symbol;
- Ideal computer that uses fixed time per elementary operation;
What are elementary operations?
- Higher grades + faster learning
- Never study anything twice
- 100% sure, 100% understanding
What is the definition of the algorithm running time?
When does an algorithm running time belong to an easy problem and when to a hard problem considering the following;
- n 2
- 2 n
2 n | Hard problem
Give the algorithm running time of the following for sorting algorithms
- Bubble sort;
- Quick sort;
- Shell sort;
- Heap sort;
Quick sort | O(n 2 )
Shell sort | O(n 3/2 )
Heap sort | O(n log n)
What are the 2 algorithm running times rules and what do they imply
If an algorithm consists of 2 sub algorithms with running times O(f(n)) and O(g(n)) then, running time = O(max{f(n), g(n)})
Product rule
If an algorithm running time consists of executing O(f(n)) times a subroutine with running time (O(g(n)) then,
running time = O(f(n)*g(n))
The question on the page originate from the summary of the following study material:
- A unique study and practice tool
- Never study anything twice again
- Get the grades you hope for
- 100% sure, 100% understanding
![Trustpilot Logo](/images/design_2020/lp/clp-trustpilot-en.png)