Question 9
AQA Computer Science June 2020 Paper 2GCSE9 marks
On the specification
- 9.1
- 3.3 Fundamentals of data representation
- 9.2
- 3.3 Fundamentals of data representation
- 9.3
- 3.3 Fundamentals of data representation
Question text
9 Figure 1 shows a Huffman tree that has been created to represent the string shown in Figure 2. Figure 1 Figure 2 COMPUTER SCIENCE IS THE BEST SUBJECT 9.1 Use the Huffman tree in Figure 1 to state the Huffman encoding for the string MOST [3 marks] M O S T 9 2 box . A student was asked to describe how a Huffman tree could be created for the string in Figure 2. Her response was: “I would count the number of times each character appears in the string and create a frequency table sorted alphabetically. For example, the letter S has the highest frequency in Figure 2. Next I would take the two characters with the largest frequencies and combine them into a new node. The new node would be added to the end of the frequency table. The two characters with the lowest remaining frequencies are now combined into a new node and the process is repeated until all the characters have been added to nodes and the tree created.” State four mistakes the student has made in her response. [4 marks] 1 2 3 4 9.3 When the Huffman tree in Figure 1 is used, the string in Figure 2 can be represented using 130 bits. The 36-character string shown in Figure 2 could also be encoded using ASCII. How many bits are saved when Huffman coding is used rather than ASCII to represent the string shown in Figure 2? You must show your working. [2 marks] Answer 9