Algorithm Interview Archive

Minimum Number of Jumps to reach last Index

If you want to practice data structure and algorithm programs, you can go through 100+ data structure and algorithm programs. In this post, we will see how to find Minimum Number of Jumps to reach …

Largest Rectangular Area in a Histogram

If you want to practice data structure and algorithm programs, you can go through 100+ data structure and algorithm programs. In this post, we will see about how to find largest rectangular area in a …

Sliding Window Maximum in java

In this post, we will see about Sliding Window Maximum in java Problem Given an Array of integers and an Integer k, Find the maximum element of from all the contiguous subarrays of size K. …

Print maximum occurring character in a String

In this post, we will see how to print the maximum occurring character in a String. Problem Print maximum occurring character in a String For example: String 1: java2blog tutorial Character: a has occurred maximum …

Print all paths from top left to bottom right of MxN matrix

In this post, we will see how to print all paths from top left to bottom right of MxN matrix. Problem We need to print all paths from top left to bottom right of MxN matrix. …

Print Numbers from 1 to N without using loop

In this post, we will see how to print numbers from 1 to N without using loop. Problem Print number from 1 to N without using any loop. N=10 Output: 1 2 3 4 5 …

Find all subsets of set (power set) in java

In this post, we will see how to find all subsets of set or power set in java. Problem Given a set of distinct integers, arr, return all possible subsets (the power set). For example: Input: nums …

Permutations of array in java

In this post, we will see how to find all permutations of the array in java. Problem 1 Given array of distinct integers, print all permutations of the array. For example: array :  Permuations are …

Count all paths from top left to bottom right of MxN matrix

In this post, we will see about how to count all paths from top left to bottom right of MxN matrix. Problem We need to count all paths from top left to bottom right of MxN …

Memoization example in java

In this tutorial, we will see about Memoization example in java. Let me start with the question. Would you like to do same task again and again when you know that it is going to …