Please enable JavaScript.
Coggle requires JavaScript to display documents.
Data Structure - Coggle Diagram
Data Structure
Stacks
-
Application
Used for expression evaluation (e.g.: shunting-yard algorithm for parsing and evaluating mathematical expressions).
-
Explanation
A stack is a LIFO (Last In First Out — the element placed at last can be accessed at first) structure which can be commonly found in many programming languages.
-
Arrays
Explanation
An array is a structure of fixed-size, which can hold items of the same data type.
Application
Used as the building blocks to build other data structures such as array lists, heaps, hash tables, vectors and matrices.
Used for different sorting algorithms such as insertion sort, quick sort, bubble sort and merge sort.
-
Heaps
Operation
Min Heap — the key of the parent is less than or equal to those of its children. This is called the min-heap property. The root will contain the minimum value of the heap.
Max Heap — the key of the parent is greater than or equal to those of its children. This is called the max-heap property. The root will contain the maximum value of the heap.
Application
-
Used to implement priority queues as the priority values can be ordered according to the heap property where the heap can be implemented using an array.
-
-
Explanation
A Heap is a special case of a binary tree where the parent nodes are compared to their children with their values and are arranged accordingly.
Hash Tables
Operation
-
-
m: Size of the hash table (number of slots available). A prime value that is not close to an exact power of 2 is a good choice for m.
-
-
Linked Lists
Operation
Search: Find the first element with the key k in the given linked list by a simple linear search and returns a pointer to this element
Insert: Insert a key to the linked list. An insertion can be done in 3 different ways; insert at the beginning of the list, insert at the end of the list and insert in the middle of the list.
Delete: Removes an element x from a given linked list. You cannot delete a node by a single step. A deletion can be done in 3 different ways; delete from the beginning of the list, delete from the end of the list and delete from the middle of the list.
-
Explanation
Used for different sorting algorithms such as insertion sort, quick sort, bubble sort and merge sort.
Graphs
Operation
Directed graph
A graph G is said to be a directed graph if all its edges have a direction indicating what is the start vertex and what is the end vertex.
Undirected graph
A graph G is said to be an undirected graph if all its edges have no direction. It can go in both ways between the two vertices.
Application
Used to represent social media networks. Each user is a vertex, and when users connect they create an edge.
Used to represent web pages and links by search engines. Web pages on the internet are linked to each other by hyperlinks. Each page is a vertex and the hyperlink between two pages is an edge. Used for Page Ranking in Google.
Used to represent locations and routes in GPS. Locations are vertices and the routes connecting locations are edges. Used to calculate the shortest route between two locations.
-
Trees
-
Application
-
Binary Search Tree: used in many search applications where data are constantly entering and leaving.
-
-
-
Queues
-
-
Explanation
A queue is a FIFO (First In First Out — the element placed at first can be accessed at first) structure which can be commonly found in many programming languages.