Chp 10 Flashcards
(23 cards)
What’s a data type
A classification attributed to an item of data which determines the type of value it can take and how it can be used
What’s an identifier
A unique name applied to an item of data
What’s a record
It’s a composite data type comprising several related items that may be of different data types
What’s a composite data type
A data type constructed using several of the data types available in a particular programming language
Whats an array
A data structure containing several elements of the same data type
What’s an index
A numerical indicator of an item of data’s position in an array
What’s linear search
A method of searching in which each element of an array is checked in order to
What’s bubble sort
A method of sorting data in an array into alphabetical or numerical order by comparing adjacent items and swapping them if they are in the wrong order
What’s a file
A collection of data stored by a computer program to be used again
What’s ABT abstract data type
A collection of data and a set of operations on that data
What’s a stack
A list containing several items operating on the last in, first out (LIFO) principal
items can be added to the stack (push) and removed from the stack (pop).
What’s a queue
A list containing several items operating in the first in first out (FIFO) principle
items can be added to the queue (enqueue) and removed from the queue (dequeue).
What’s a linked list
a list containing several items in which each item in the list points to the next item in the list. In a linked list a new item is always added to the start of the list
What are the 6 data types
Boolean
Char
Date
Integer
Real
String
What type of data type are records
They’re composite data types
what’s are the identifiers that are put in a linear search model there’s 6 of them
- item —> thing that needs to be found
- mylist —> array to be searched
- upperBound
- lowerBound
- index —> pointer to current array element
6.found —> flag to show when it’s found
what are the 7 identifiers you need to know for bubble sort
- my list —> array that needs to be searched
- UB
- LB
- index
- swap
- top —> index of last element to compare
- temp —> temporary storage location during swap
what are the 3 modes in files
read
write —> writes data to a file in any existing data stored in file so it will be overwritten
append —> adds data to the end of file
what’s EOF
it is used to test for the end of the file
it will return the value true if the end of a file has been reached
and a false otherwise
what are the two pointers that a stack uses
- a base pointer
it points to the first item in the stack
- a top pointer
points to the last item in the stack
if they equal then there’s one item in stack
what are the two pointers a queue has
- a front pointer
points to the first item in the queue
- a rear pointer
points to the last item in the queue
what’s a node
it’s in a linked list when an item in a linked list is stored together with a pointer to the next item
and the last item in a list had a null pointer
why should a queue be managed as a circular queue
if items are removed from the front and added to the end of a queue, the position of the queue in the array changes so we should manage it with circular queue to avoid moving the position of the items in the array everytime an item is removed