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.