Paper 1 Module 4 Flashcards

1
Q

What are arrays?

A

An array is an ordered, finite set of elements of a single data type.

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

What are lists?

A

A list is a data structure consisting of a number of ordered items where the items can occur more than once. The values are stored non-contiguously. This means that they do not have to be stored next to each other in memory.

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

What are tuples?

A

An ordered set of values of any type is called a tuple. A tuple is immutable, which means it cannot be changed. elements cannot be added or removedonce it has been created.

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

What is a linked list?

A

A linked list is a dynamic data structure used to hold an ordered sequence. Each item is called a node, and contains a data field alongside another address called a link or pointer field.

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

What is a graph and what are the 3 types of a graph?

A

A graph is a set of vertices/nodes connected by edges/arcs.

Directed Graph
Undirected graph
Weighted Graph

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

What is a directed graph?

A

It is a graph where it’s 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 undirected graph?

A

It is a graph where its edges can be traversed boths directions.

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

What is a weighted graph?

A

It is a graph where a “cost” is added to each edge.

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

What two ways do computers process graphs?

A

Adjacency matrix
Adjacency List

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

What are the advantages for using an Adjacency Matrix for graphs?

A

Convinient to work with due to quicker access times.
Easy to add nodes.

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

What is an advantage for using an adjacency list?

A

More space efficient for large, sparse networks.

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

What is a dynamic data structure?

A

It is a data structure whose size and structure can be changed during runtime.

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

What are stacks?

A

A stack is a last in first out data structure. Items can only be added to or removed from the top of the stack. Stacks are key data structures in computer science; they are used to reverse an action.

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

What are queues?

A

A queue is a first in first out data structure ; items are added to the end of the queue and are removed from the front of the queue.

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

What is a tree? (in computer science)

A

A tree is a connected form of a graph. Trees have a root node which is the top node in any tree. Nodes are connected to other nodes using branches, with the lower-level nodes being the children of the higher-level nodes.

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

What is a binary tree?

A

A binary tree is a type of tree in which each node has a maximum of two children. These are used to represent information for binary searches, as information in these trees is easy to search through. The most common way to represent a binary tree is storing each node with a left pointer and a right pointer.

17
Q

What are the 3 ways that a binary tree can be traversed?

A

Pre-order
In-order
Post-order

18
Q

What way do you go when traversing a binary using Pre-order traversal?

A

Pre-order traversal follows the order :- root node, left subtree, then right subtree.

19
Q

What way do you go when traversing a binary using In-order traversal?

A

In-order traversal follows the order: left subtree, root node, right subtree.

20
Q

What way do you go when traversing a binary using Post-order traversal?

A

Post order traversal follows the order : Left subtree, right subtree, root node.