DoublyLinkedList

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

Max Sum Contiguous Subarray

Max Sum Contiguous Subarray   Find the largest sum of a given contiguous subarray   int[] array = { -2, 1, -3, 3, -1, 2, 1, -5, 4 };   Output:  5…

Jump Search

Jump Search   Jump Search can be applied on sorted collections. It is better than Linear Search but worse than Binary Search.   Basically, in Jump Search, we divide the collection into…

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…

Insert Node at Nth position in Circular LinkedList

Insert Node at Nth position in Circular LinkedList   To insert the Node at the nth position in the circular linked list   Iterate the list till n-1th node. set the next…

LOOKBOOKS

SUBSCRIBE

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

Lorem ipsum dolor sit amet, consectetur a dipiscing elit. Vivamus leo ante,

FOLLOW US ON