Question 13
AQA Computer Science June 2018 Paper 2GCSE7 marks
On the specification
- 13.1
- 3.3 Fundamentals of data representation
- 13.2
- 3.3 Fundamentals of data representation
Question text
13 The Huffman tree shown in Figure 6 was created to encode the string shown in box Figure 5. The frequency of each character is shown in brackets. For example, the letter A appears five times within the string shown in Figure 5. Figure 5 AAGHHGGSAAASG Figure 6 13.1 Complete the code table below for characters G, S and H for the Huffman tree shown in Figure 6. The code for character A has already been completed. [3 marks] Character Binary code A 0 G S H 13.2 The string shown in Figure 5 could also be encoded using ASCII. ASCII uses 7 bits to box represent each character. How many bits are saved by using Huffman coding rather than ASCII to represent the string shown in Figure 5? You must show your working. [4 marks] Answer: 7