Chapter 4 Flashcards
What are balanced parentheses?
They are parentheses for which there is a corresponding closing symbol for every opening symbol
What is a data field?
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
What is a deque?
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.
What is FIFO?
First in First out, used by queues.
What is fully parenthesised?
A fully parenthesised equation means there are brackets around every part of the equation, e.g. A+B+C+D = ((A+B)+C)+D)
What is a head?
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
What is infix?
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.
What is LIFO?
Last in First out, used by stacks.
What is a linear data structure?
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.
What is a linked list?
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.
What is a node?
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.
What is linked list traversal?
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
What is a palindrome?
A word that is spelt the same forwards as it is backwards, can be checked for using a deque.
What is postfix?
A way of ordering operators in expressions, the operator is after the operands e,g, A B +
What is precedence?
It is the order of execution for operators, following BIDMAS