## Exercises: Algorithm Efficiency

May 072018Before attempting these exercises, you should read the posts on dynamic analysis and static analysis.

Before attempting these exercises, you should read the posts on dynamic analysis and static analysis.

Efficiency is important; people don’t like waiting for computers to slowly do things that ought to be fast.

(This interactive feature requires Javascript to be enabled in your browser.)

So far we’ve been thinking about this in vague terms; we know, for example:

*Getting*from an array-list is faster than from a linked list,- Binary search is faster than linear search,
- Merge sort is faster than selection sort.

Now it’s time to go into detail: how do we know how fast an algorithm is?