Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1Block 3 -> Block 2 -> Block 1 | ABlock 5: previous = Block 4 | |
| 2chain = [B1, B2, B3]; chain.append(B4) | BA new block is added to the end of the chain, after the newest existing block | |
| 3Blocks are kept in time order, with the oldest block first and the newest block last | CEach block links back to the block before it, so the blocks form a chain | |
| 4Each new block stores a link to the block before it | DBlock 1 (09:00) <- Block 2 (09:10) <- Block 3 (09:20) | |
| 5New Block 6 is inserted between Block 2 and Block 3 | ENew blocks must be added to the end of the chain, not into the middle. Inserting a block breaks the time order of the chain. | |
| 6Block 4: previous = none (but Blocks 1 to 3 already exist) | FA block that is not the first one must link to the block before it. Here Block 4 is not linked, so it is not joined to the chain. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
chain of blocks — Blocks are added one after another in time order. Each new block goes on the end and links to the block before it, so the blocks form a chain.Block3.previous ← Block2APPEND Block4 TO chainBlock5.previous ← Block4IF Block2.time > Block1.time THEN
OUTPUT "Block 2 is newer"
ENDIF[Block 1]<-[Block 2]<-[Block 3]<-[Block 4]