Paper 1 Module 4 Flashcards

(35 cards)

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.

21
Q

What is the definition of a graph?

A

It is a data structure used to represent relationships between objects, often visualized as nodes (vertices) connected by edges (arcs)

22
Q

what is a loop when in context of graphs?

A

it is a node with an edging pointing to itself.

23
Q

what are leaf nodes?

A

They are nodes in a tree that do not have any children.

24
Q

How do we add items to a binary tree?

A

If the value of the new data added is less than the value in the current node then branch left, otherwise branch right.

25
What is a load factor?
n/k A load factor is a number between 1-0 where n is the number of occupied positions on an array and k is the number of positions in the array. For a hash table, the optimal loadfactor is 0.75.
26
How do we know if a binary number is normalised or not?
Negative normalised numbers start with 10. Positive normalised numbers start with 01.
27
What does an AND mask do to a binary sequence?
It extracts the bits that are needed from that are not needed. Example:- Binary 1 0 0 1 1 1 0 1 Mask 1 0 0 1 0 0 0 0 Out 1 0 0 1 0 0 0 0 The 1s in the sequence are extracted by the 1s in the mask.
28
What does an OR mask do to a binary sequence?
We use 1s to where we want the 1s in the output and 0s to leave them alone.
29
What does a XOR mask do to a binary sequence?
The binary sequence becomes toggled where the mask is applied. (1s) Example:- Binary 1 0 0 1 1 1 0 1 Mask 1 1 1 1 0 0 0 0 Out 0 1 1 0 1 1 0 1
30
What is a half adder?
It is a circuit used in computer systems to perform binary addition, can handle single bit addition only.
31
what is a full adder?
It is a circuit used in computer systems to perform binary addition, capable of managing carry inputs from previous calculations.
32
What is a D type flip flop?
The D-type flip flop is a synchronous sequential circuit that can be used to store the value of a single binary digit.
33
How do you work around with a D type flip flop?
If there is a clock signal AND the value of D is 1. Then the value of Q is one. The value of Q is one until there is a clock signal AND the value of D is 0.
34
What do all positive normalised binary numbers start with?
01
35
what do all negative binary numbers start with?
10