1.4.2 Data Structures & in Paper 2 Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is a Graph?

A

An abstract data structure used to show relationships between items.

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

What is the definition for Node/Vertex?

A

An item, or piece of data

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

What is an Edge/Arc?

A

A relationship between nodes.

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

Describe a Weighted Graph

A

Each edge has a value, or a cost to travel.

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

Describe an unweighted graph

A

Edges have no values or costs.

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

What is a Directed Graph?

A

Edges can only be traversed in one direction.

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

What is an Adjacency Matrix?

A

A table to show the relationships in a graph.

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

What is an Undirected Graph?

A

Edges can be traversed in any direction.

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

What is an Adjacency List?

A

A space-efficient way to store the relationships in a graph.

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

What is the definition of Static?

A

Structures with a fixed length.

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

What is the definition of Dynamic?

A

Structures with a changeable length.

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

What is the definition of Array?

A

A static, ordered set of elements of the same type

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

What is the definition of Tuple?

A
  • A static, ordered set of elements of any type.
  • Immutable.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is a 2D array?

A
  • An array that contains other arrays.
  • Often used to store tables
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is a Linked List?

A
  • An abstract, dynamic data structure…
  • Which holds ordered data from different locations
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are the steps in inserting an item into linked lists?

A
  • Use nextFree to place the item in the next free node
  • Follow pointers from start until you find the node with data greater than the item.
  • Change the pointer of the previous node to point to your item.
  • Change the pointer of your item to point to the next code.
17
Q

What is a List?

A

An abstract data structure that stores a number of items.

18
Q

What is the general method to adding items to an ordered list?

A

Is the list full? If so, stop.
REPEAT:
If targetIndex<nextIndex:
move all items along by 1
insert them
ELSE:
Look at next list item.

19
Q

What is Depth-first traversal ?

A

Read a graph by going as far down each route as
you can before backtracking.

20
Q

What is Breadth-first traversal ?

A

Read a graph by checking all available routes
from a node before progressing.

21
Q

What is a Binary Search Tree ?

A

A rooted tree where each node has a maximum of two children.
Makes data easy to search.

22
Q

What are the 3 ways you can be traversing a binary tree ?

A
  • Pre-order (to the left)
  • In order (underneath)
  • Post-order (to the right)
23
Q

What is abstract data structure?

A

A data structure made by the
programmer.

24
Q

What is a Queue ?

A

A static, first-in-first-out structure for
ordering data.

25
Q

What does enQueue(item) do ?

A

Add an item to the rear of the list.

26
Q

What does deQueue() do ?

A

Remove the item from the front of the
list.

27
Q

What does isEmpty()/isFull() do ?

A

Check if the list is empty / is full.

28
Q

What is a Stack ?

A

A Last In First Out (LIFO) data structure.
Usually used to store instructions.

29
Q

What is the Call Stack ?

A

A structure to hold the active subroutines
and their data.