Flashcards
5. Data Structures

Cards in this deck (18)
- 1See AS for basic description of arrays and records-.-
- 2How can arrays and records be used to allow arrays to store more than one data type?An array of records can be created
- 3What are the properties of the list data type?- Stores same data types
- Mutable - 4What are the properties of the tuple data type?- Stores same data types
- Immutable - 5What are the properties of the stack data type?- Last In First Out (LIFO) data type
- One pointer pointing to the last item - 6What are the properties of the queue data type?- First In First Out (FIFO) data type
- One pointer pointing to the last item and one pointing to the first - 7What is 'pushing'?Adding an item to a stack
- 8What is 'popping'?Removing an item from a stack
- 9What is 'peeking/topping'?Viewing the last item in the stack
- 10What is the algorithm for pushing to a stack?1. Check if the stack is full
2. If full, return an error
3. Increment pointer
4. Insert new data at the pointer position - 11What is the algorithm for popping from a stack1. Check if the stack is empty
2. If empty, return an error
3. Copy data from the pointer position
4. Decrement pointer - 12What is the algorithm for inserting into a queue?1. Check if the queue is full
2. If full, return an error
3. Increment the back pointer
4. Insert data at the pointer location - 13What is the algorithm for removing from a queue?1. Check if the queue is empty
2. If empty, return an error
3. Copy data from the front pointer location
4. Decrement the pointer - 14Circular queue visulisation

- 15How do we know that a circular queue is full?The rear pointer is one place behind the front pointer
- 16How do we know that a circular queue is empty?The rear pointer is on the same place as the front pointer
- 17What are the properties of a priority queue?- All items added have a priority
- Their position when added to the queue depends on their priority - 18Priority queue example

Information
- Description
- A Level Computer Science ((A2) Unit 4: Computer Architecture, Data, Communication...) Flashcards on 5. Data Structures, created by Scott Jones on 12/10/2020.
- Created by
- Scott Jones
- Views
- 0
- Rating