Daniel Sutantyo, Department of Computing, Macquarie University
1.2 - Complexity Analysis
1.2 - Complexity Analysis
... or can you?
... how about single-threaded vs multi-threaded algorithm?
1.2 - Complexity Analysis
1.2 - Complexity Analysis
1.2 - Complexity Analysis
The Art of Computer Programming
Donald E. Knuth
The imaginary MIX computer
1.2 - Complexity Analysis
Basically, you have a computer that can only do primitive operations, then break down your algorithm to those operations and see how many operations they need to complete the computation
If you can think in terms of C or Assembly (COMP2100/202), then you should have a good idea.
If not, think of the average Java program that you wrote back in COMP1010/125
single-threaded vs multi-threaded
Problem: is it realistic?
multiplication vs addition
1.2 - Complexity Analysis
Is it perfect? No, but it allows us to have a simple model of our algorithm that we can analyse
The idea is, if in our simple model we see that Algorithm A is better than Algorithm B, then if we apply Algorithm A in the real world, it will probably still be better than Algorithm B
1.2 - Complexity Analysis
1.2 - Complexity Analysis
1.2 - Complexity Analysis
\(T(n) \approx n^2\)
1.2 - Complexity Analysis
Analysing an algorithm can be hard, so we need to use a simplified model
To analyse an algorithm, break it down to its primitive operations and count the number of operation it takes to finish