Data Structures- S7 Flashcards
Array
A finite, ordered set of elements of the same type.
In a 1-dimensional array how would you write the pseudocode, when you want the fourth item in the array called Family
Family[4]
Tuples
a dynamic data structure where the elements do not have to be the same type, and the number of elements in tuple can increase or decrease.
What is a Record
A data type that allow you to store data permanently so you can read and update it at future dates. Often a database.
What does a file consist of?
A file consists of records and a record holds a number of fields.
What is Abstract data types?
data type created by the programmer rather than defined in a programming language. E.g queues, stacks
What is Static Data Structure?
a collection of data in memory that is fixed in size and cannot increase or decrease in size while the program is running.
What is a Dynamic Data Structure?
a collection of data in memory that has the ability to increase or decrease in size while a program is running.
What is a Queue?
An ordered collection of items where new elements are added at the end of a queue and removed from the front of the queue.
What are queues used for in Computing?
Queues are used for waiting to print (queue on disk), characters typed at a keyboard (keyboard buffer).
How do you push an item in a queue?
Check if full. If not then add one to the rear pointer, add item to rear and increase size of array
How do you pop an item?
Check if empty. If not return item at front pointer. Add one to the front pointer and decrease size of array by one.
How can you over come limitations on data size ?
Have a dynamic data structure, or do circular queue
What’s a list?
An abstract data type consisting of a number of items which may occur more than once.
What does array.index(3) do?
returns what position 3 is in