NEW
Font size
Worksheetsgamay rani ha
Total questions: 30
Worksheet time: 15mins
All of these are reasons why Data Structures matter, EXCEPT for:
Faster processing
Handling large data
Helps you study
Organized code
An example of a common data structure is:
Plates
Array
Pop
Peek
It is a data structure that store multiple values of the same data type in a single variable.
Array
Dictionary
Stack
Queue
It is a data structure that stores data in pairs called key and value.
Array
Dictionary
Stack
Queue
This kind of data structure follows the LIFO principle.
Array
Dictionary
Stack
Queue
Unlike Stack, this data structure follows the FIFO principle.
Array
Dictionary
Stack
Queue
Which number does indexing start at in Arrays?
-1
0
1
Not enough information
Each value is stored in a specific position called a __.
key-value pair
pop
index
push
All of these are reasons why you would use an Array except for:
Organizes related data efficiently
Reduces the need to create code
Makes data processing easier
Reduces the need for multiple variables
grado_sa_test = [11, 14, 8, 2, 4] Using the command grado_sa_test[3], what is the output?
11
4
8
2
game_stats = {"name" : "067","kills" : 0,"assists" : 6,"deaths" : 7,} Using the function game_stats["name"], what is the output?
067
0
6
7
This stack operation checks if the stack is empty.
Push
Pop
Peek
IsEmpty
This stack operation views the top element without removing it.
Push
Pop
Peek
IsEmpty
This stack operation adds an element to the top of the stack.
Push
Pop
Peek
IsEmpty
This stack operation removes the top element.
Push
Pop
Peek
IsEmpty
stack = [] stack.append("Emphasis") stack.append("Paypa") stack.pop() stack.append("Otagan") What is our current stack?
stack = [Emphasis, Paypa]
stack = [Paypa]
stack = [Emphasis, Otagan]
stack = [Otagan, Emphasis]
queue = [] queue.append("DIO") queue.append("Fraud-volo") queue.pop(0) queue.pop(0) queue.append("Yoshikage GOAT")
queue = [DIO, Yoshikage GOAT]
queue = [Fraud-volo, Yoshikage GOAT]
queue = [Yoshikage GOAT]
queue = [DIO]
This queue operation adds an element to the back of the queue.
Enqueue
Dequeue
Front
IsEmpty
This queue operation removes the element from the front of the queue.
Enqueue
Dequeue
Front
IsEmpty
This queue operation checks the front element of the queue without removing it.
Enqueue
Dequeue
Front
IsEmpty
This type of file stores data in human-readable formats.
.txt
.png
.bin
.exe
This type of file stores data in machine-readable formats.
.txt
.bin
.png
.exe
All of these are examples of .txt files, except for one.
.txt
.csv
.html
file = open("students.???", "r") What does this line of code most likely do?
Opens a .txt file
Saves a .txt file
Opens a .bin file
Saves a .bin file
file = open("GTA6LEAKED.???", "wb") What does this line of code most likely do?
Opens a .txt file
Saves a .txt file
Opens a .bin file
Saves a .bin file
file = open("EmphasisPics.???", "w") What does this line of code most likely do?
Opens a .txt file
Saves a .txt file
Opens a .bin file
Saves a .bin file
file = open("EpsteinFiles.???", "rb") What does this line of code most likely do?
Opens a .txt file
Saves a .txt file
Opens a .bin file
Saves a .bin file
All of these are examples of .tbin files, except for one.
.bin
.exe
.csv
.docx
file = open("DiddyPartyInvitation.???", "rb+") What does this line of code most likely do?
Opens and saves a .txt file
Overwrites a .txt file
Opens and saves a .bin file
Overwrites a .bin file
file = open("robloxpassword.???", "ab+") What does this line of code most likely do?
Appends and writes a .bin file
Appends and writes a .txt file
Appends a .bin file
Appends and reads a .bin file
