Please enable JavaScript.
Coggle requires JavaScript to display documents.
1.4.2 - Coggle Diagram
1.4.2
Storing data
Linked list
A linked list is a dynamic data structure which is used to hold an ordered sequence. Each item in the list is called a node and contains a data field and a next address field called a link or pointer field. The data field holds the actual data associated with the list item, and the pointer field contains the address of the next item in the sequence. The link field in the last item indicates that there are no further itms by the use of a null pointer.
Graph
A graph is a set of vertices or nodes connected by edges of arcs. A two-dimensional array which is used to store information about a directed or undirected graph. Each of the rows and columns represents a node, and a value stored in the cell at the intersection of row i, column j indicates that there is an edge connecting node i and node j.
Stack
A stack is a Last In First Out (LIFO) data structure. This means that items are added to the top and removed from the top. If data wanted to be added, the push function would be used. If an item was to be taken out the pop function would be used to remove it.
Queue
A queue is a Last In First Out (LIFO) data structure. New elements may only be added to the end of a queue, and elements may only be retrieved from the front of a queue. To add an item the enQueue function is needed and to remove an item the deQueue function is needed.
Tree
A tree is a nonlinear data structure, compared to arrays, linked lists, stacks and queues which are linear data structures. A tree can be empty with no nodes or a tree is a structure consisting of one node called the root and zero or one or more subtrees. There are three ways of traversing a tree. They are pre-order, In-order and Post order traversal.
Binary tree search
A binary tree is a rooted tree in which each node has a maximum of two children. A binary search tree holds an item in such a way that the tree can be searched quickly and easily for a particular item, new items can be added easily, and the whole tree can be printed out in a sequence.
Hash table
A hash table is a collection of items stored in a way that the items can be easily accessed. The hash table could be implemented as an array or a list of a given size with a number of empty spaces.
Data structures
Arrays
This data structure is static, homogeneous and mutable. This means that no data can be added or taken away from the data structure, there can't be multiple data types in the data structure and data can be modified.
Arrays can have different numbers of dimensions. For example there can be 1D, 2D and 3D arrays. One dimensional arrays is just a normal array while a 2D array is multiple arrays within one array. A 3D array is when there are multiple arrays within multiple arrays within one array.
Lists
This data structure is dynamic, non homogeneous and mutable. This means that data can be added or taken away from the data structure, there can be multiple data types in the data structure and data can be modified.
Tuples
This data structure is static, non homogeneous and immutable. This means that no data can be added or taken away from the data structure, there can be multiple data types in the data structure and no data can be modified.
Records
This data structure is static, non homogeneous and mutable. This means that no data can be added or taken away from the data structure, there can be multiple data types in the data structure and data can be modified.