wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

CodeHS 5.1 & 5.2 Intro to Data Structures

Total questions: 10

Worksheet time: 7mins

Name
Class
Date
1.

What is a data structure?

a)

another name for a class

b)

data stored as a set of variables

c)

variables inherited from a parent class

d)

data organized in a particular way

e)

baby don't hurt me

2.

Which data structures were introduced in Lesson 5.1?

Wrong answers only.

a)

array

b)

2D array

c)

ArrayList

d)

HashMap

e)

BinaryTree

3.

What is an array?

a)

a data structure that stores a fixed number of values of the same type

b)

a data structure that stores a dynamic number of values of the same type

c)

a data structure that stores information organized with a key

d)

a data structure that stores information at two-dimensional coordinates

4.

An array is kinda like ...

a)

a list

b)

a group

c)

a chess board

d)

a phonebook ... wait, do you even know what that is?

5.

Make me an array.

a)

int[ ] foo = new int[5];

b)

int[ ] foo = {0, 1, 2, 3, 4}

c)

int[ ] foo = new int[0, 1, 2, 3, 4];

d)

int[ ] foo = new Array(5);

e)

POOF! You're an array

6.

What is the name of the value that denotes an element of an array?

a)

index

b)

number

c)

key

d)

bound

7.

What is the index of the final element of an array called foo?

a)

foo.length - 1

b)

foo.length

c)

foo.last

d)

foo.last + 1

8.

Good geeks start counting at

(a)  

9.

A 9-hole golf course is introducing an app to replace paper scorecards. The total

score is the number of times the player hits the ball to complete all 9 holes.

The final scores are stored within the app.

State the most suitable data structure and data type for storing the final score

for each hole.

Data structure: ​ (a)  

Data type: ​ (b)  

Choose from the below words
1-D array
integer
2-D array
String
float
Boolean
char
set
linked list
HashMap
10.

Given the array, { 5, 4, 2, 6, 7, 1, 9 }, at what index is the value 1?

a)

6

b)

5

c)

7

d)

3