Data Structures Flashcards
What is a Primitive Data Type
One in which the set of values of the type are scalar meaning single values.
What is a Composite Data Type
Any data type which can be constructed using the programming languages primitive data types and other composite types.
What is Abstraction
A representation where all unnecessary details are removed.
What is a List
An ordered collection of data items.
What is a Dynamic Data structure
Can change size at run time.
Advantages of Static Data Structures
Access times are constant.
Disadvantages of Static Data Structures
Unutilised spaces are a waste in memory.
Advantages of Dynamic Data Structure
Avoid wasting memory space.
Disadvantages of Dynamic Data
- Resize operation takes time.
- In dynamic non-linear structures the access time depends on the position of the element in the structure.
What is a Stack
A Last In First Out data structure where data can only be accessed at the top end.
What is the function of the Push() Operation in a stack
An item is added to the top of the stack
What is the function of the Pop() Operation in a stack
The top item is removed from the stack.
What is the function of the Peek() / Top() Operation in a stack
Returns the value of the top element of the stack, without removing it.
What is Reverse Polish Notation
The operator comes after the value it is operated on.
What are the Advantages of Reverse Polish Notation
- No need for Brackets.
- No need to define operator precedence (BIDMAS)
- Expression can be evaluated serially - no need to bracktrack.
- Faster for computers to evaluate.
What is a Queue?
A First In First Out data structure
What is the function of the Enqueue() Operation in Queues
An item is added in the location of the rear pointer of the queue.
What is the function of the Dequeue() Operation in Queues
AN item is removed in the location of the front pointer of the queue.
What is a Linear Queue
Elements join the queue at one end and leave at the other end.
What is a Shuffle Queue
The front of the queue is fixed as the first data slot. Each time an element is removed, other elements move one position forward to fill the vacated slot.
What is a Circular Queue
When the array element with the largest possible index has been used, the next element to join the queue reuses the vacated position at the beginning of the array.
What is a Priority Queue
Each element of priority queue has an associated priority.
What is Recursion
Recursion happens when a function calls itself and has a terminating condition.