Skip to content

Course home

Algorithms

Algorithms

EasyMedium
123456789101112131415161718
Question 1

An algorithm is designed to reverse the order of elements in an array.

Scores = [15, 3, 9, 7, 18]
Count = 0
Size = 4
Limit = 2
Temp = 0

WHILE Count < Limit
    Temp = Scores[Count]
    Scores[Count] = Scores[Size - Count]
    Scores[Size - Count] = Temp
    Count = Count + 1
ENDWHILE

Complete the trace table below for this algorithm. You may not need to use all of the empty rows.

CountSizeLimitTempScores[0]Scores[1]Scores[2]Scores[3]Scores[4]
04201539718
[5]
Markscheme

Algorithms Questions

  1. IGCSE
  2. /Computer Science
  3. /Algorithms

45 exam-style questions on Edexcel IGCSE Computer Science Algorithms. Each one has a worked solution and a mark scheme showing where the marks go.

Question bank