Chapter 4 Flashcards

1
Q

What are balanced parentheses?

A

They are parentheses for which there is a corresponding closing symbol for every opening symbol

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

What is a data field?

A

It is the part of an object in which the data is stored, e.g. an instance variable of a node in which the data field wen the ould be self.data = data with data being passed as an attribute in the constructor

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

What is a deque?

A

It is a linear data structure in which you are able to remove and add from both the front and the rear of a list simultaneously. It is good when you want to narrow down to a value in the middle or want to remove from a list and iterate between both sides, so one iteration on one side, then the next iteration would be on the other.

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

What is FIFO?

A

First in First out, used by queues.

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

What is fully parenthesised?

A

A fully parenthesised equation means there are brackets around every part of the equation, e.g. A+B+C+D = ((A+B)+C)+D)

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

What is a head?

A

A head is the beginning of a list, the only item you are able to access directly from an ordered or unordered LinkedList. It is the first node in a linked list and all subsequent nodes are accessed via linked list traversal

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

What is infix?

A

It is a way of ordering the operator in an expression, with the operator being in between the two operands. Precedence must be specified when using infix notation.

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

What is LIFO?

A

Last in First out, used by stacks.

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

What is a linear data structure?

A

All the elements in a linear data structure are sequential, which each element at most having one predecessor and one successor. They are all ordered contiguously in memory except for linked lists.

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

What is a linked list?

A

A linear data structure in which all items are stored in random memory address and are linked together via pointers in nodes. The nodes contain the data field and a pointer to the next item in the list.

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

What is a node?

A

A node is a data type which contains a data field, the data that is to be stored and a pointer to a memory address.

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

What is linked list traversal?

A

A way of traversing a linked list in which the current element is stored in a temporary variable and the next item is retrieved by updating the temporary variable. The traversal ends when the value of the variable IS None

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

What is a palindrome?

A

A word that is spelt the same forwards as it is backwards, can be checked for using a deque.

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

What is postfix?

A

A way of ordering operators in expressions, the operator is after the operands e,g, A B +

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

What is precedence?

A

It is the order of execution for operators, following BIDMAS

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

What is prefix?

A

A way of ordering operators in expressions, the operator is after the operands, e.g., + A B. Used in scheme

17
Q

What is a queue?

A

A linear data structure which follows the FIFO principle. The first element in is the first item in the list and you can only remove items from the front and add items to the back.

18
Q

What is a simulation?

A

The process of creating a model of a real-world system or process and running experiments on that model to understand behavior or test scenarios.

19
Q
A