Fundamentals of data
structures
Last edited time @November 12, 2023 11:03 AM
Status Done
Data structures and abstract data types
Data structure → a common format for storing large volumes of related data,
which is an implementation of an abstract data type. Examples include files,
stacks and queues.
Abstract data type → A conceptual model of how data can be stored and the
operations that can be carried out on the data.
File → a collection of related data. Files allow for data to be portable and
accessible on different computers. They also enable saving and loading of
data.
Text file → a file that contains human-readable characters. Common text
file formats include CSV and txt (shown below):
An example CSV file.
An example txt file
Fundamentals of data structures 1
, Binary file → A file that stores data as a sequence of 1s and 0s. These
files are commonly displayed in hexadecimal form for conciseness.
Record → one line of a text file.
Field → An item of data.
Array → A set of related items stored under a single variable identifier
(name). They can have multiple dimensions and can be likened to a table.
They are also indexed with the first item having and index of 0. An array is
stored as a set allocation of memory which is found from the number of items
in the array (its length) and the type of the item within the array.
Static and dynamic data structures
📌 NOTE: Queues and Stacks are discussed in more detail later on.
Queue → A data structure where the first item added is the first item
removed.
Stack → A data structure where the last item added is the first item removed.
Very much like a stack of plates.
Static data structure → A method of storing data where the amount of data
stored (and the memory allocated) is fixed. This allocation is defined by the
programmer. This allows for very quick access times as their memory location
is fixed.
Fundamentals of data structures 2