Describe an algorithm. (1)
A finite sequence of step-by-step instructions carried out to solve a problem.
In a list of 8 numbers, what is the middle number? (Sorting)
5
In a flow chart: describe the shapes used for Start/End, Instruction and Decison
Rounded rectangle, rectangle, diamond
How is the lower bound of a bin packing algorithm found? (2)
Sum the terms, and divide by number of bins.
Always round up.
What is the order of an algorithm?
A measure of its efficiency as a function of the size of the problem.
An algorithm has order nlogn, and can sort 100 items in 0.3 seconds. Estimate the time needed for 100 items.
0.3 x (1000log(1000) / 100log(100))
= 0.3 x 15
= 4.5