Data Structures

Data structures are ways of arranging data. Some of the well-known data structures used for solving computational problems are as below

  1. Linked Lists, store data and links in a structure called a node. The links in each node point to the next node in the list. Linked lists are of below types
    a) Singly linked list, has nodes containing a single link (next) that points to the next node in the list. The last node in a singly linked list points to NULL. The last node in a singly linked list points to NULL.
    b) Doubly linked list, has nodes containing two links (previous & next). One link points to the previous node in the list and the other points to the next node in the list. The last node in a singly linked list points to NULL.
    c) Circular linked list, can be a singly linked or a doubly linked list. Where the last node in the list points to the first node or the Head node of the list.

  2. Stack, stores data objects or items on top of each other. The last item to go inside the stack is placed at the top of the stack and is accessed first. To access the item below the top of the stack, the topmost item has to be removed before the item below it can be accessed. Thus, the stack follows the convention LIFO i.e Last In First Out.

  3. Queue, stores data objects or items in a way that is very similar to a supermaket billing queue. i.e The data item or the object that enters the queue first is the first item to be taken out followed by the next item. Thus, the queue follows the convention FIFO i.e First In First Out. Some programming languages like C++, Java, and Python also provide a Deque or Double Ended Queue that has the functionality for inserting and removing data from both ends.

  4. Heap, is essentially a tree-like data structure in which the data at the root is greater than or equal to the data stored in the child node(s) (MaxHeap) or the data at the root is less than or equal to the data stored in the child node(s) (MinHeap). Heap is usually implemented using Priority Queues.

  5. Adjacency List, is a list-of-list that usually stores the data inside a tree or a graph.



Construct Implementation
Graph Adjacency list. (C++) (Java) (Python)
MaxHeap Priority Queue. (C++)


Copyright (c) 2019-2021, Algotree.org.
All rights reserved.