1.4.2 Data Structures Flashcards

(11 cards)

1
Q

Types

A

Array: Fixed size, static, holds a single data type
List: No fixed size, dynamic, hold multiple data types
Tuple: Is immutable. Round brackets not square brackets
Record: Made up of fields

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

Linked list

A

Each item is called a node
Datafield: The actual data
Start Pointer
NextFree Pointer
For each record: Index, Data, Pointer

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

Graphs

A

Implemented using an adjency matrix or adjacency list

Directed Graph: Only traversed on direction
Undirect Graph: Edges traversed both directions
Weighted graph: Each arc has a cost

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

Stacks

A

Stack underflow: When item called but is empty
peek() – returns top value

Used to reverse actions

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

Queues

A

Queue overflow
Head and tail pointer

Circular queues:
Rear point that can loop back to the front

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

Trees

A

Node
Edge
Root
Child
Parent
Subtree (Section)
Leaf (No children)

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

Binary tree

A

Each node stored with left and right pointer

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

Hash tables

A

Array coupled with hash function
Colision: Next available location

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

Pre-order

A

Root node, left subtree, right subtree
(Pass)

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

In-order

A

Left, root, right
(Pass under)

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

Post-order

A

Left, right, root
(pass on right)

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