Determine the number of times a step in an algorithm will be performed for given input data.


Teaching Note:

Examination questions will involve specific algorithms (in pseudocode/flow charts), and students may be expected to give an actual number (or range of numbers) of iterations that a step will execute.


Sample Question - FORMER CURRICULUM - A Bit beyond what required now, but the same sort of idea.:

Given a program which functions like a linked list (HL 2 May 2008, question 1):

(b) State the BigO efficiency of adding nodes to the list. [1 mark]
(c) State the BigO efficiency of searching through the list for a particular node. [1 mark]

JSR Notes:

But recall that this is still by looking at pseudocode, not actual Java or JETS.

So, for example, in the iteration of a loop within a loop, how many times would the outer loop and inner loop in a nested looping situation repeat. A great example here would be a bubble sort; so the outer loop (passes) would be one less than the length of the array (assuming it is dumb), yet the inner loop comparison steps happen a many times each pass (again, depending on smart or dumb version).

--> A specific example here would be good; for now just look at sorting notes and sort for x number of elements, dumb, or smart, or smartest.