Skip to content

Category Archives: Data Structures

Bellman-Ford Algorithm: The Bellman-Ford algorithm is a single-source shortest-path algorithm that works by iteratively relaxing edges in the graph until the shortest path to all… Read More
Solving GATE Previous Year’s Questions (PYQs) not only clears the concepts but also helps to gain flexibility, speed, accuracy, and understanding of the level of… Read More
A heap is a complete binary tree where each node satisfies the heap property. The heap property is different for different types of heaps but,… Read More
Given an array arr[] of length n, the task is to find the minimum number of operations required to make a permutation of integers 1… Read More
Given an array X[] of size N, then the task is to output the number of sub-arrays satisfying the given condition: The Sum of (X[i]… Read More
Given a singly linked list, the task is to replace every node with its closest bell number. Bell numbers are a sequence of numbers that… Read More
Given an integer array arr[] of size N, the task is to count the number of pairs whose BITWISE AND and BITWISE XOR are equal.… Read More
Given a binary tree and a target, find the number of nodes in the minimum sub-tree with the given sum equal to the target which… Read More
Given a linked list and a key to be deleted. The task is to delete the first occurrence of the given key from the linked… Read More
Given a permutation arr[] of size n  and a positive integer x, the task is to sort the permutation in increasing order by performing the… Read More
Given a pile of n pairs of elements in array arr[], containing 2*n elements, we have to print with the following conditions follow: If pair… Read More
Given a matrix of size (n*m) and a point ‘p‘ (x, y). The matrix is given in the form of 0‘s and 1‘s. In one… Read More
Given an array arr[] of length n, the task is to calculate the min index of the element which has maximum elements present in the… Read More
Given an N x N matrix of positive integers. The task is to find the shortest path from the first cell of the matrix to… Read More
Given a sorted array arr[] of size N, the task is to find the length of the longest subarray and print the subarray such that… Read More