A weighted graph is a special type of graph in which the edges are assigned some weights which represent cost, distance and many other relative… Read More

# Category Archives: Data Structures

Unweighted graph is a type of graph with no edge weight. In an unweighted graph, the edges represent the connection between two nodes. If there… Read More

Deque is a type of queue in which insert and deletion can be performed from either front or rear. It does not follow the FIFO… Read More

Circular Queue is a linear data structure that follows FIFO (first in first out) principle which means the item that is inserted first in the… Read More

Given an array arr[] of size N, the task is to find the maximum value that can be obtained by following the below conditions: Select… Read More

A height-balanced binary tree is defined as a binary tree in which the height of the left and the right subtree of any node differ… Read More

Given an array A[], the task is to find the circulant matrix made by this array. A circulant matrix is a square matrix of order… Read More

Given an array arr[] of size N and a positive integer K, the task is to check if the array can be reordered such that… Read More

Given a directed graph with N nodes and M edges in array V[], the task is to find the number of nodes that are accessible… Read More

Given an undirected tree with N nodes numbered from 1 to N and an array A[] where A[i] denotes the value assigned to (i+1)th node.… Read More

Directed graphs are graphs that have directed edges between the nodes. If a directed edge points from u to v then, v is adjacent to… Read More

Tree is a non-linear data structure. It consists of nodes and edges. A tree represents data in a hierarchical organization. It is a special type… Read More

Given a circular array arr[] of size N, the task is to find the next integers of same parity for every element in arr[]. If… Read More

Given a string S of length N, the task is to find the number of unique subsequences of the string for each length from 0… Read More

Red-Black Tree is one type of self-balancing tree where each node has one extra bit that is often interpreted as colour of the node. This… Read More