#17 Arrays, Records, Tuples and Hash Tables

#17 Arrays, Records, Tuples and Hash Tables

11th - 12th Grade

15 Qs

quiz-placeholder

Similar activities

WI 11 Latin America In the 20th Century

WI 11 Latin America In the 20th Century

9th - 12th Grade

10 Qs

EKG Chapter 8 Test

EKG Chapter 8 Test

12th Grade

20 Qs

Weather Patterns Quiz

Weather Patterns Quiz

3rd Grade - University

14 Qs

Activity no.1

Activity no.1

11th Grade

10 Qs

Quiz on Chapters 55-57 Where the Crawdads Sing

Quiz on Chapters 55-57 Where the Crawdads Sing

11th Grade

20 Qs

Solar System Review

Solar System Review

2nd Grade - University

12 Qs

11/7: CH. 10-18 Test

11/7: CH. 10-18 Test

9th - 12th Grade

20 Qs

Supply and Demand Together

Supply and Demand Together

11th Grade

15 Qs

#17 Arrays, Records, Tuples and Hash Tables

#17 Arrays, Records, Tuples and Hash Tables

Assessment

Quiz

others

11th - 12th Grade

Medium

Created by

Claire Buckler

Used 2+ times

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

2. Which of these applies to an array?
A. Elements must be of the same data type
B. Elements can be of any data type as there are no type rules on the array
C. One element can contain a single value while other elements contain multiple values or data structures
D. Specific array index values can be set to different numbers where necessary

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

3. In the array nums = {0,1,5,2,1), which of the following is false?
A. There are five elements
B. 5 is one element
C. There are two elements
D. Two elements have the same value

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

4. In the following array, which of these commands would determine the number of characters in "Crab"? zoo = ["Pig", "Wolf", "Crab"],
A. zoo.length[3]
B. zoo[2].length
C. zoo[3].length
D. zoo[3][4]

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

5. Which of the following would place an 'X' as the first element in a 2D array of characters which has the identifier 'grid'?
A. grid.length(0)[0] = 'X'
B. grid]='X'
C. grid[0][0] = 'X'
D. grid['X'].charAt(0)

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

6. Twenty-seven different coloured cubes are arranged into a larger cube shape. The colour of each individual cube is unique and is represented as a 5-bit colour code, e.g. 00000=black, 10101=pink. A 3D array of strings is used to represent the arrangement of the 27 smaller cubes into a 3x3x3 arrangement. If cube [0][0][0] represents the top-left cube on the top row, which of these represents the bottom-right cube on the bottom row?
A. cube[0][1][2]
B. cube[3][3][3]
C. cube[0][3][0]
D. cube[2][2][2]

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

7. Which of these is the most suitable data structure for modelling a chess board in a computerised chess game in such a way that the squares on the board store the value of the chess piece at that square?
A. Tuple
B. 3D array
C. 2D array
D. 1D array

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

8. When visiting all of the elements of a 2D array, which of these approaches is suitable?
A. Use two nested iterative structures. Each time you progress to a new row, recalculate the length of that row as it may not contain the same number of columns as the row before it.
B. Use two nested iterative structures. Each time you progress to a new row, you will not have to recalculate the length of that row as it will be the same as the row before it.
C. Use a do-while (aka repeat-until) loop. It has built-in capabilities to handle 2D arrays efficiently.
D. Use three nested iterative structures. The two inner iterative structures (FOR loops are commonly used) will visit each of the elements, but a third outer loop is required to manage any additional checks such as IF statements that need to be carried out.

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?