# Heap data structure (minheap and maxheap examples)

Heap is physically an array-like storage data structure whereas virtually we can see this as a binary tree. In heap data structure the element in the 0th index represents as the root of the tree and its children indices are calculated using the below formula. Example of Heap Let’s take a heap example that hasRead More »

# How to find merge point of two linked lists

Let us take two linked lists which at some point merge as one list. Our goal is to find the point where the given two linked lists merging. The most optimized solution for this problem is to find the maximum length list and jump each node until both lists length becomes the same. Below isRead More »

# Graph data structure introduction

Graphs are most commonly using a data structure in computer applications, networks, and maps. These are introduced in early computing days. By definition a graph with “V” vertices (nodes) and “E” edges, where each edge “e” associates with one or more vertices. A graph with nodes {A, B, C, D, E} and edges {e1, e2,Read More »

# Binary search tree

A binary search tree is a binary tree, with the content of all elements in the left subtree of a node are lesser than the content in the parent. Whereas all nodes content in its right subtree are greater than its parent. Let’s see below two example binary search trees. As observed in the aboveRead More »

# Binary Tree data structure

A binary tree is a tree data structure with a maximum of two children in each node. Similarly, the recursive meaning of a binary tree is a tree (L, P, R) where L and R are binary trees with P as root. A binary tree node has pointed to at most another two nodes. ARead More »

# Queue data structure (Linear Queues & Circular Queues)

Queues are data structures on which operations are done in the first-in-first-out(FIFO) order. Unlike stacks, queues are open at both ends. For example lets take a simple queue of people who are standing to enter into an exhibition. There are two types of queues, those are Linear Queues and Circular Queues. Below is a linearRead More »

# Stack data structure

Stack is the most popular and historical data structure. A list of items arranged one on top of others. Stack data structure popularly used to maintain program memory stack. It follows the last-in-first-out order. Let’s consider a stack of discs as shown in the below picture. As shown in this diagram, only the top nodeRead More »

A circular linked list is one type of linked list on which the last node links with the head node and form circular. Let’s see some pictorial representation of the circular list. Now, let’s take an example and solve basic operations. Insert Delete Insert Insert operation done in two different ways, insert at the endRead More »

# Doubly Linked List data structure

Doubly linked list is the list that most programming languages uses in their libraries (like, java lists, c++ lists…etc). The problem with linked lists is that we can’t move backward from any respective node. To overcome this problem Doubly Linked Lists (DLL) comes into the picture. Unlike nodes in linked lists here Node has twoRead More »

# Singly Linked List data structure

Major drawback while inserting, deleting into arrays is to shift all elements right side when insert or delete element to satisfy arrays continuous memory policy. Linked List data structure came up with random memory linking of nodes to overcome the above shifting problem. These nodes can be linked/chained to the next node memory location, theRead More »

# Array data structure

As mentioned in its dictionary meaning, the array is “range of particular type of things”. Here in computer science array is a range of the same types of objects. Objects here represents any programming language objects i.e., char, short, int, float, double or Object…etc. It stores in contiguous memory locations in the application memory. Let’sRead More »