Save
Computer science OCR A Level
1.4.2 Data Structures
Save
Share
Learn
Content
Leaderboard
Share
Learn
Created by
Aanya Sinha
Visit profile
Cards (82)
What is an array?
An
ordered
,
finite
set of elements
View source
What is a one-dimensional array also known as?
A
linear array
View source
How are arrays indexed by default?
Zero-indexed
View source
What is the output of print(oneDimensionalArray[3]) for the array [1, 23, 12, 14, 16, 29, 12]?
14
View source
How can a two-dimensional array be visualized?
As a
table
or spreadsheet
View source
In a two-dimensional array, how do you search for a position?
Go down
rows
then across
columns
View source
What is the syntax to access an element in a three-dimensional array?
threeDimensionalArray
[z,y,x]
View source
What is the output of print(threeDimensionalArray[0,1,2]) for the array [[[
12,8
],[9,6,19]],[[241,89,4,1],[
19,2
]]]?
19
View source
What is a record commonly referred to as?
A
row
in a file
View source
What are records made up of?
Fields
View source
How can fields in a record be accessed?
Using
recordName
.
fieldName
View source
What is a list?
A
data structure
of ordered items
View source
How do lists differ from arrays?
Lists can store non-
contiguous
items
View source
What is the output of List.isEmpty() if List = [23, 36, 62, 49 , 23, 29, 12]?
False
View source
What does List.append(value) do?
Adds
a
new
value to the end
View source
What does List.remove(value) do?
Removes the first
occurrence
of value
View source
What does List.length() return?
The length of the
list
View source
What is a tuple?
An ordered set of
immutable
values
View source
How are tuples initialized?
Using regular
brackets
View source
What happens if you try to change a tuple's value?
It results in a syntax
error
View source
What is a linked list?
A
dynamic
data structure for
sequences
View source
What does each node in a linked list contain?
A
data field
and a
pointer field
View source
What is the purpose of the pointer field in a linked list?
To link to the
next
item
View source
How do you traverse a linked list?
Start
at the 'Start' pointer
View source
What is an advantage of using linked lists?
Values can be easily
added
or removed
View source
What is a disadvantage of linked lists?
They waste memory due to
pointers
View source
What is a graph?
A set of
vertices
connected by
edges
View source
What is a directed graph?
Edges
can only be
traversed
one way
View source
What is an adjacency matrix?
A matrix representing
graph connections
View source
What is a stack?
A last in first out (
LIFO
) structure
View source
How are items added to a stack?
Only at the
top
of the stack
View source
What is a common use of stacks?
To reverse an
action
View source
What is the preferred implementation for static stacks?
When
maximum size
is known
View source
What is the role of a pointer in a stack?
Points
to the
top
of the
stack
View source
What are the main operations that can be performed on a stack?
Push
: Add an item to the top
Pop
: Remove the top item
Peek
: View the top item without removing it
View source
What are the advantages of using an adjacency matrix?
Quick
access times
Easy to add
nodes
View source
What are the advantages of using an adjacency list?
More space efficient for
large
,
sparse networks
View source
What are the strengths and weaknesses of linked lists?
Strengths:
Dynamic size
Easy to add/remove items
Weaknesses:
More
memory
required
Cannot access items directly
View source
What is the data structure type of a stack?
Last in
first out
(
LIFO
)
View source
How do items get added or removed from a stack?
Only from the
top
of the stack
View source
See all 82 cards