Liquidated Data Structures Flashcards

1
Q

Describe arrays.

A

A data structure for storing an ordered, finite set of elements of a single data type within a single identifier.
Always zero-indexed unless stated otherwise.

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

What are 1D arrays considered to be?

A

Linear arrays

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

2D ARRAYS
How can they be visualized?

A

As a table or spreadsheet.

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

2D ARRAYS
How do you search across them?

A

When searching through them, go down the rows then across the columns to find a given position.

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

3D ARRAYS
How can they be visualized?

A

3D arrays can be visualized as a multi-page spreadsheet, or as multiple 2D arrays

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

3D ARRAYS
How do you search across them?

A

The three dimensions are used [z,y,x].
Z is the array number, y is the row number, x is the column number

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

Describe records.

A

A data structure that stores data in a row of elements called fields, organised based on attributes.

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

Describe lists.

A

A data structure that stores a sequence of data values, each with a unique index.

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

How are lists different from arrays?

A

They can contain elements of more than one data type.

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

Describe static and dynamic data structures

A

Static
• Structure size cannot change at runtime

Dynamic
• Structure size can change at runtime

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

Describe mutable and immutable

A

Immutable
• Structure/data cannot be changed at runtime (overall cannot be modified)

Mutable
• Structure/data can be changed at runtime

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

Describe stacks.

A

A Last in First out (LIFO) data structure.
Items can only be pushed (added) or popped (removed) from the top.
The top is identified with a top pointer.
It is preferably static. (easier to implement, more efficient memory use)

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

Describe linear queues.

A

First in First out (FIFO) data structure
Items are added to the end (enqueue) and removed at the front (dequeue).
Has a front pointer and a rear pointer.

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

Describe circular queues

A

First in First out (FIFO) data structure
Once the queue’s rear pointer is equal to the max size of the queue, it can loop back to the front of the array and store values here, provided it is empty.
Harder to implement, but uses space in an array more effectively.

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

Define tuple

A

A data structure for storing an immutable, ordered set of data, which can be of different data types within a single identifier.

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

What is different about the way tuples are initialized?

A

Regular brackets are used instead of square

17
Q

What is different about the way arrays and tuples are accessed?

A

Nothing. They can be accessed the same way (with the exception of changing the value).

18
Q

Define linked list.

A

Dynamic data structure used to hold an ordered sequence. Each item is called a node, and contains a data field and a pointer which points to the next item in the list.