SLR 14 Flashcards

Data Structures

1
Q

What is a data structure?

A

A way data can be stored in programming

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a record

A

A collection of related fields

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What number do indexes start at?

A

0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does it mean if a data structure is static?

A

The size of the structure size can’t change during runtime

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does it mean if a data structure is dynamic?

A

The structure size can change during runtime

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does it mean if a data structure is mutable?

A

Data inside can be changed during runtime

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the attributes of a list?

A

Dynamic
Mutable
Items are ordered
Can store more than one data type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the attributes of an array?

A

Static
Mutable
Ordered
Items can change
Only one data type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the attributes of a tuple?

A

Static
Immutable
Ordered
Items can’t be changed
More than 1 data type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a linked list?

A

A data structure that provides a foundation for other structures, made up of nodes and pointers that are used to link nodes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a graph?

A

A data structure that uses nodes and pointers similarly to a linked list, but also has vertices and edges

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is a Pre-Order Traversal?

A

Travels a graph from the left of a node

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is an in-order traversal?

A

Travels a graph from the bottom of a node

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is a post-order traversal?

A

Travels a graph from the right side of each node

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What structure does a stack follow?

A

LIFO

Last in, first out

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What does a stack do before any changes are made?

A

Checks if the stack is full if it is pushed onto the stack

Checks if the stack is empty if an item is to be popped

17
Q

What are the attributes of a queue?

A

Linear
Items can be peeked at
Uses FIFO
Has a front and back pointer

18
Q

What is a queue overflow?

A

Adding to a full queue

19
Q

What is a queue underflow?

A

Taking from an empty queue

20
Q

What is a circular queue?

A

A queue which cycles back to the start to avoid affecting frame rates

21
Q

What are circular queues used for?

A

Process scheduling
Transferring data across processors l
Performing breadth-first searches

22
Q

What is a tree?

A

A fundamental data structure that uses nodes and pointers, while also starting with a root node and having leaf nodes which branch off them

23
Q

What is a binary tree?

A

A data structure similar to a tree but only has nodes with 0, 1 or 2 pointers connecting to a different node

Binary searches can be performed on these easily

24
Q

What is a hash table?

A

A function that finds an item in a list without comparing it to other items in the data set

It determines a hash value for a value to find an item

25
Q

How are collisions prevented in hash tables?

A

Every available space is checked until an empty one if found to store an item

You can also store an item in the same space twice in a 2 dimensional hash table. This is called chaining.