Representing algorithms

EasyMediumHard
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
Question 36
Easy

Three vertical columns, labeled 0, 1, and 2, contain blocks.

The operation MOVE(source, destination) removes the single top block from the column specified by source and places it onto the top of the column specified by destination.

The diagram below shows the initial arrangement of the blocks:

Three vertical columns labeled 0, 1, and 2. Column 0 contains three blocks stacked vertically: block "X" is at the top, block "Y" is in the middle, and block "Z" is at the bottom. Column 1 and Column 2 are empty.

Draw or describe the final arrangement of the blocks in each of the three columns after the following sequence of instructions has run:

MOVE(0, 2)
MOVE(0, 1)
MOVE(2, 1)
[3]

Representing algorithms Questions

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