wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

gamay rani ha

Total questions: 30

Worksheet time: 15mins

Name
Class
Date
1.

All of these are reasons why Data Structures matter, EXCEPT for:

a)

Faster processing

b)

Handling large data

c)

Helps you study

d)

Organized code

2.

An example of a common data structure is:

a)

Plates

b)

Array

c)

Pop

d)

Peek

3.

It is a data structure that store multiple values of the same data type in a single variable.

a)

Array

b)

Dictionary

c)

Stack

d)

Queue

4.

It is a data structure that stores data in pairs called key and value.

a)

Array

b)

Dictionary

c)

Stack

d)

Queue

5.

This kind of data structure follows the LIFO principle.

a)

Array

b)

Dictionary

c)

Stack

d)

Queue

6.

Unlike Stack, this data structure follows the FIFO principle.

a)

Array

b)

Dictionary

c)

Stack

d)

Queue

7.

Which number does indexing start at in Arrays?

a)

-1

b)

0

c)

1

d)

Not enough information

8.

Each value is stored in a specific position called a __.

a)

key-value pair

b)

pop

c)

index

d)

push

9.

All of these are reasons why you would use an Array except for:

a)

Organizes related data efficiently

b)

Reduces the need to create code

c)

Makes data processing easier

d)

Reduces the need for multiple variables

10.

grado_sa_test = [11, 14, 8, 2, 4] Using the command grado_sa_test[3], what is the output?

a)

11

b)

4

c)

8

d)

2

11.

game_stats = {"name" : "067","kills" : 0,"assists" : 6,"deaths" : 7,} Using the function game_stats["name"], what is the output?

a)

067

b)

0

c)

6

d)

7

12.

This stack operation checks if the stack is empty.

a)

Push

b)

Pop

c)

Peek

d)

IsEmpty

13.

This stack operation views the top element without removing it.

a)

Push

b)

Pop

c)

Peek

d)

IsEmpty

14.

This stack operation adds an element to the top of the stack.

a)

Push

b)

Pop

c)

Peek

d)

IsEmpty

15.

This stack operation removes the top element.

a)

Push

b)

Pop

c)

Peek

d)

IsEmpty

16.

stack = [] stack.append("Emphasis") stack.append("Paypa") stack.pop() stack.append("Otagan") What is our current stack?

a)

stack = [Emphasis, Paypa]

b)

stack = [Paypa]

c)

stack = [Emphasis, Otagan]

d)

stack = [Otagan, Emphasis]

17.

queue = [] queue.append("DIO") queue.append("Fraud-volo") queue.pop(0) queue.pop(0) queue.append("Yoshikage GOAT")

a)

queue = [DIO, Yoshikage GOAT]

b)

queue = [Fraud-volo, Yoshikage GOAT]

c)

queue = [Yoshikage GOAT]

d)

queue = [DIO]

18.

This queue operation adds an element to the back of the queue.

a)

Enqueue

b)

Dequeue

c)

Front

d)

IsEmpty

19.

This queue operation removes the element from the front of the queue.

a)

Enqueue

b)

Dequeue

c)

Front

d)

IsEmpty

20.

This queue operation checks the front element of the queue without removing it.

a)

Enqueue

b)

Dequeue

c)

Front

d)

IsEmpty

21.

This type of file stores data in human-readable formats.

a)

.txt

b)

.png

c)

.bin

d)

.exe

22.

This type of file stores data in machine-readable formats.

a)

.txt

b)

.bin

c)

.png

d)

.exe

23.

All of these are examples of .txt files, except for one.

a)

.txt

b)

.csv

c)

.pdf

d)

.html

24.

file = open("students.???", "r") What does this line of code most likely do?

a)

Opens a .txt file

b)

Saves a .txt file

c)

Opens a .bin file

d)

Saves a .bin file

25.

file = open("GTA6LEAKED.???", "wb") What does this line of code most likely do?

a)

Opens a .txt file

b)

Saves a .txt file

c)

Opens a .bin file

d)

Saves a .bin file

26.

file = open("EmphasisPics.???", "w") What does this line of code most likely do?

a)

Opens a .txt file

b)

Saves a .txt file

c)

Opens a .bin file

d)

Saves a .bin file

27.

file = open("EpsteinFiles.???", "rb") What does this line of code most likely do?

a)

Opens a .txt file

b)

Saves a .txt file

c)

Opens a .bin file

d)

Saves a .bin file

28.

All of these are examples of .tbin files, except for one.

a)

.bin

b)

.exe

c)

.csv

d)

.docx

29.

file = open("DiddyPartyInvitation.???", "rb+") What does this line of code most likely do?

a)

Opens and saves a .txt file

b)

Overwrites a .txt file

c)

Opens and saves a .bin file

d)

Overwrites a .bin file

30.

file = open("robloxpassword.???", "ab+") What does this line of code most likely do?

a)

Appends and writes a .bin file

b)

Appends and writes a .txt file

c)

Appends a .bin file

d)

Appends and reads a .bin file