#17 Arrays, Records, Tuples and Hash Tables

#17 Arrays, Records, Tuples and Hash Tables

11th - 12th Grade

15 Qs

quiz-placeholder

Similar activities

Mr. Popper's Penguins 19-20

Mr. Popper's Penguins 19-20

4th Grade - University

14 Qs

Quiz sull'Energia Idroelettrica

Quiz sull'Energia Idroelettrica

8th Grade - University

15 Qs

Vocabulario y Lectura

Vocabulario y Lectura

9th - 12th Grade

20 Qs

Chapter 3 Review

Chapter 3 Review

5th Grade - University

17 Qs

USH - Unit 1 Test

USH - Unit 1 Test

11th Grade

10 Qs

PS LISTRIK MAGNET SUMBER ENERGI

PS LISTRIK MAGNET SUMBER ENERGI

9th Grade - University

13 Qs

Early WW2 Quiz

Early WW2 Quiz

11th Grade

15 Qs

Presentation Skills Assessment

Presentation Skills Assessment

11th Grade

20 Qs

#17 Arrays, Records, Tuples and Hash Tables

#17 Arrays, Records, Tuples and Hash Tables

Assessment

Quiz

others

11th - 12th Grade

Practice Problem

Medium

Created by

Claire Buckler

Used 2+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?