Data types and structures
185 questions. Open a question to solve it and check the official answer.
Arrays · 2 marks · official answer ready
(i) Describe how the Xs and Os would be stored in a two-dimensional array called Grid. [2]
Arrays · 2 marks · official answer ready
(i) Describe how the Xs and Os would be stored in a two-dimensional array called Grid. [2]
Data types and records · 6 marks · official answer ready
(a) Complete the table. Use a single value for the size. Data Identifier Data Type Size (in bytes) subject Subject STRING examination title level Level 1 date sat DateSat mark Mar…
Data types and records · 4 marks · official answer ready
(ii) In a programming language write the declaration for the record structure, giving it the identifier Exam. Programming language Declaration [4]
Arrays · 2 marks · official answer ready
(i) Explain the difference between a static and a dynamic data structure. [2]
Arrays · 1 mark · official answer ready
(ii) What benefit would be gained from using a dynamic data structure to implement a binary tree? [1] 11 The initially empty tree has the following items added in this order: For …
Arrays · 3 marks · official answer ready
(b) Draw the binary tree after these four items have been added. [3] 12
Arrays · 4 marks · official answer ready
(ii) The diagram shows a trace of the execution of this algorithm for the given tree For data. Examiner's Use Fill in the missing lines of code. InOrder(PEPPER) LeftP[PEPPER] 0 is…
Arrays · 1 mark · official answer ready
(iii) What do the arrows in the diagram represent? [1] 14
Data types and records · 2 marks · official answer ready
(i) Explain what is meant by code optimisation. [2]
Arrays · 1 mark · official answer ready
(i) CountCharacter(City1, 6, ‘O’) [1]
Arrays · 1 mark · official answer ready
(ii) CountCharacter(City2, ‘R’, 8) [1]
Arrays · 1 mark · official answer ready
(iii) CountCharacter(City3, 9, ‘t’) [1]
Arrays · 1 mark · official answer ready
(iv) CountCharacter(City2, ’W’) [1] 19
Data types and records · 3 marks · official answer ready
(i) Show the function header for function StringFound. [3]
Arrays · 2 marks · official answer ready
(i) Explain the difference between a static and a dynamic data structure. [2]
Arrays · 1 mark · official answer ready
(ii) What benefit would be gained from using a dynamic data structure to implement a binary tree? [1] 11 The initially empty tree has the following items added in this order: For …
Arrays · 3 marks · official answer ready
(b) Draw the binary tree after these four items have been added. [3] 12
Arrays · 4 marks · official answer ready
(ii) The diagram shows a trace of the execution of this algorithm for the given tree For data. Examiner's Use Fill in the missing lines of code. InOrder(PEPPER) LeftP[PEPPER] 0 is…
Arrays · 1 mark · official answer ready
(iii) What do the arrows in the diagram represent? [1] 14
