## Minimum edges to be added in a directed graph so that any node can be reachable from a given node

Given a directed graph and a node X. The task is to find the minimum number of edges that must be added to the graph… Read More »

- How can one become good at Data structures and Algorithms easily?
- Find maximum in a stack in O(1) time and O(1) extra space
- Cracking Technical Interviews
- Print the nodes of binary tree as they become the leaf node
- Reach the numbers by making jumps of two given lengths
- Lower and Upper Bound Theory
- Shannon-Fano Algorithm for Data Compression
- Rearrange Odd and Even values in Alternate Fashion in Ascending Order
- Dijkstra's shortest path with minimum edges
- Sort the array of strings according to alphabetical order defined by another string
- Sum of similarities of string with all of its suffixes
- How to write a Pseudo Code?
- Check if it is possible to reach a number by making jumps of two given length
- Code Optimization Technique (logical AND and logical OR)
- Dividing a Large file into Separate Modules in C/C++, Java and Python
- Find the number in a range having maximum product of the digits
- Smallest power of 2 which is greater than or equal to sum of array elements
- Iterative Letter Combinations of a Phone Number
- Ternary Search
- Program to print the Zigzag pattern
- Merge K sorted arrays | Set 3 ( Using Divide and Conquer Approach )
- Largest perfect square number in an Array
- Length of the longest alternating subarray
- Smallest Pair Sum in an array
- Number of array elements derivable from D after performing certain operations
- Count distinct substrings that contain some characters at most k times
- Color N boxes using M colors such that K boxes have different color from the box on its left
- Jump Pointer Algorithm
- Choose atleast two elements from array such that their GCD is 1 and cost is minimum
- Find alphabet in a Matrix which has maximum number of stars around it

Given a directed graph and a node X. The task is to find the minimum number of edges that must be added to the graph… Read More »

Given an array arr[] of N integers and an integer M where N % M = 0. The task is to find the minimum number… Read More »

Given two strings A and B of equal lengths, the task is to find an index i such that A[0…i] and B[i+1…n-1] give a palindrome… Read More »

Given a spirally sorted matrix with N * N elements and an integer X, the task is to find the position of this given integer… Read More »

Given an integer array containing digits from [0, 9], the task is to print all possible letter combinations that the numbers could represent. A mapping… Read More »

Given k sorted arrays of different length, merge them into a single array such that the merged array is also sorted. Examples: Input : {{3,… Read More »

Given two arrays A1 and A2 of N numbers. There are two people A and B who select numbers out of N. If A selects… Read More »

Given an array arr[], the task is to find the minimum number of elements that must be removed to make the array good. A sequence… Read More »

Given a range [L, R] and two positive integers N and M. The task is to count the numbers in the range containing only non-zero… Read More »

Given three positive integers N, L and R. The task is to find the number of ways to form an array of size N where… Read More »

Given a range [L, R] where L ≤ R, the task is to generate a random permutation of the sequence [L, L + 1, L… Read More »

Given a number N. The task is to find the smallest special prime which is greater than or equal to N. A special prime is… Read More »

Given two integers N and K, the task is to find a permutation of integers from the range [1, N] such that the number of… Read More »

Given a number N(1 ≤ N ≤ 1018) without leading zeros. The task is to find the minimum number of moves required to make N… Read More »

There arises several situations while solving a problem where we need to iterate over all possible combinations of an array. In this article, we will… Read More »