Chapter 7 - Data Structures and Abstract Data Types
Static Data Structure
*Fixed in size* and cannot increase in size or free up memory while the program is running. Eg. the size of an array has to be decared in advance.
Data Structure
*Implementation* of an Abstract Data Type. A collection of elementary data types such as *integer*, *real*, *Boolean* etc.
Queue
A *First In, First Out* (FIFO) data structure. The first item added is the first item removed.
Stack
A *Last In, First Out* (LIFO) data structure. The last item added is the first item removed.
Array
A *finite*, *ordered set of elements* of the same type. Can work with multiple dimensions. Arrays are *static data structures*
Dynamic Data Structure
A collection of data in memory that has the ability to *grow or shrink in size*. This is done with the *aid of the heap*.
Abstract Data Type (ADT)
A data type whose properties & operations are specified independently of any particular programming language. This results in *data abstraction*.
Heap
A portion of memory from which space is automatially *allocated or de-allocated* as required.
Binary File
Can contain records with *different types of field*, occupying a *different number of bytes* etc. Data is stored as a *string of 1s and 0s* & the format has to be known by the program.
Files
Consists of a number of *records*. A record contains a number of *fields*, each holding an *item of data*.
Text File
Contains *human readable characters* (decoded from binary).
