Topic 2 Fundamentals of data structures Flashcards
(12 cards)
What are data structures?
Used by computers as the containers within which information is stored.
What is an array?
An indexed set of related elements
What are the requirements of an array?
Be finite, indexed and must only contain elements with the same data types
What number do arrays start from?
0
How is information stored in computers?
As a series of files. Each file is made up of record which are composed of a number of fields
Describe what abstract data structures are?
Data structures that don’t exist as data structures in their own right, instead they make use of other data structures to form a new way of storing data.
What is a Queue?
An abstract data structure based on array. the first item added to a queue is the first to be removed (FIFO)
When are queues used in computer algorithms?
Used by computers in keyboard buffer, where each keypress is added to the queue then removed when the computer has processed the keypress. Ensuring the letters appear on screen in the same order they were typed.
Describe how linear queues work?
Haas two pointers a front pointer and a rear pointer. They can be used to identify to place a new item in a queue or to identify which item is at the front of the queue.
What are circular queues?
A type of queue in which the front a rear pointers can move over the top ends of the queue, making for a more memory efficient data structure
What are priority queues?
Items are assigned a priority. items with high priority are dequeued before low priority items. In the case that two or more items have same priority FIFO is used.