logo

Pearson Edexcel GCSE (9-1) Computer Science practice

An algorithm compresses a text string by replacing consecutive repeating characters with the character and the number of repeats. For example, 'AAABBC' becomes 'A3B2C1'. Outline one reason why using test data is important when evaluating the fitness for purpose of this algorithm. [2 marks]

Try the question first, then check the answer and practise the same topic again.

At a glance

Question

Type

exam_style

Style

Topic

Algorithms

Exam-style question

Try this first

An algorithm compresses a text string by replacing consecutive repeating characters with the character and the number of repeats. For example, 'AAABBC' becomes 'A3B2C1'. Outline one reason why using test data is important when evaluating the fitness for purpose of this algorithm. [2 marks].

Answer and explanation

Concise answer

Test data can reveal if the algorithm consistently produces correct compressed output for different input patterns, such as sequences of repeats at any position in the string.

Why this is correct

1 mark for stating that test data checks the algorithm gives correct output for varying input patterns. 1 mark for development linking how this confirms the algorithm consistently meets its purpose.

Use the concise answer above for a quick check, then reveal the full model answer and detailed explanation.

Common mistake

No common mistake is linked to this question yet.

Related flashcards

Flashcard 1 of 6

Press Space to flip, arrows to move

Related practice questions