Representing algorithms

EasyMediumHard
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
Question 23
Medium

This is how three blocks, X, Y, and Z, are arranged at the start of a simulation:

  • Column 0: Contains a stack of three blocks labeled Z, Y, and X from top to bottom.
  • Column 1: Empty.
  • Column 2: Empty.

Diagram showing the initial arrangement of blocks. Column 0 contains a stack of three blocks labeled Z, Y, and X from top to bottom. Columns 1 and 2 are empty.

Draw or describe the final arrangement of the blocks after the following algorithm has run.

WHILE HEIGHT(0) > 2
  MOVE(0, 1)
ENDWHILE
MOVE(0, 2)
MOVE(1, 2)
[3]

Representing algorithms Questions

  1. GCSE
  2. /Computer Science
  3. /Representing algorithms