What is Doubly LinkedList? In Doubly LinkedList, each node consist of two references. One…

### Repeated and Missing Number

Repeated and Missing Number You are given an array from 1 to n {…

### Max Sum Contiguous Subarray

Max Sum Contiguous Subarray Find the largest sum of a given contiguous subarray …

### Jump Search

Jump Search Jump Search can be applied on sorted collections. It is better than…

## Binary Search

Binary Search We are given a sorted array. Write a function to search an element n. Binary search compares the target value to the middle element of the array; if…

### Linear Search

Linear Search You are provided a collection and need to search the index of a given n number. Linear Search is a simple approach : Start from left to…

### Minimum steps in Grid

Minimum steps in Grid You are in an infinite 2D grid where you can move in any possible direction. find the minimum number of steps required to reach to the target…

### Spiral Matrix

Spiral Matrix We have given a matrix of m * n, we need to print the matrix in spiral fashion. /** * @author Gaurav Gupta */ public class SprialMatrix { static…

### Rotate the array by N positions

Rotate the array by N position import java.util.ArrayList; import java.util.List; /** * @author Gaurav Gupta * */ public class RotateArray { public static List<Integer> rotateArray(List<Integer> A, int B) { List<Integer> ret…

### Count 0 & 1 in Binary Representation

Count 0 & 1 in Binary Representation Let’s say we have number 5 whose binary representation is 101. Now think of a way to calculate it’s 0’s and 1’s. You may…

### SUBSCRIBE

Subscribe now to get notified about exclusive offers from The Voux every week!