NSSCO Computer Studies (6134) study materials
NSSCO Computer Studies (6134) study resources

NSSCO Computer Studies (6134): Algorithms, Programming and Problem Solving

NSSCO Computer Studies (6134) · Work through your exam, one topic at a time.

All guide sections

Algorithms, Programming and Problem Solving

Algorithms, Programming and Problem Solving tests whether you can design, trace and correct solutions, not just write code. You need the three control constructs, standard pseudocode, trace tables, and the ability to choose test data that exposes errors.

Constructs and tools

  • Sequence executes steps in order; selection chooses a path using IF...THEN...ELSE or CASE; iteration repeats using FOR, WHILE or REPEAT...UNTIL.
  • A flowchart uses standard symbols: oval for start or end, parallelogram for input or output, rectangle for process and diamond for decision.
  • An algorithm must be unambiguous, finite and produce a result. Pseudocode is language-independent; a program is an implementation in a specific language.

Searching and sorting

  • Linear search checks each item in turn and works on unsorted data; binary search repeatedly halves a sorted list and is much faster for large datasets.
  • Bubble sort compares adjacent items and swaps them, repeating passes until no swaps occur; insertion sort builds a sorted section one item at a time.

Worked example

Trace: total ← 0; FOR i ← 1 TO 4: total ← total + i × i; OUTPUT total. The values added are 1, 4, 9 and 16. The loop runs four times, so total = 30. A trace table would record i, the new total and the output row by row.

Traps

Use ← for assignment and = for comparison in pseudocode. Check whether a FOR loop includes its end value; it does here. Do not confuse a syntax error, which breaks the language rules, with a logic error, which runs but gives the wrong result. Test with normal, boundary and invalid data, not just one easy case.