## Travelling Salesman Problem | Set 1 (Naive and Dynamic Programming)

Travelling Salesman Problem (TSP): Given a set of cities and distance between every pair of cities, the problem is to find the shortest possible route… Read More »

## Maximum Product Cutting | DP-36

Given a rope of length n meters, cut the rope in different parts of integer lengths in a way that maximizes product of lengths of… Read More »

## Amazon Interview | Set 40 (On-Campus Round 1)

20 Objective type questions (Technical: OS, Java, Networking) and 2 programs. Time given was 90 minutes. 1) Longest Remaining Rime Scheduling 2) Threads 3) subnetmask… Read More »

## Longest Arithmetic Progression | DP-35

Given a set of numbers, find the Length of the Longest Arithmetic Progression (LLAP) in it. Examples: set[] = {1, 7, 10, 15, 27, 29}… Read More »

## Assembly Line Scheduling | DP-34

A car factory has two assembly lines, each with n stations. A station is denoted by Si,j where i is either 1 or 2 and… Read More »

## Find if a string is interleaved of two other strings | DP-33

Given three strings A, B and C. Write a function that checks whether C is an interleaving of A and B. C is said to… Read More »

## Word Break Problem | DP-32

Given an input string and a dictionary of words, find out if the input string can be segmented into a space-separated sequence of dictionary words.… Read More »

## Optimal Strategy for a Game | DP-31

Problem statement: Consider a row of n coins of values v1 . . . vn, where n is even. We play a game against an… Read More »

## Dice Throw | DP-30

Given n dice each with m faces, numbered from 1 to m, find the number of ways to get sum X. X is the summation… Read More »

## Longest Common Substring | DP-29

Given two strings ‘X’ and ‘Y’, find the length of the longest common substring. Examples : Input : X = “GeeksforGeeks”, y = “GeeksQuiz” Output… Read More »

## Minimum insertions to form a palindrome | DP-28

Given a string str, the task is to find the minimum number of characters to be inserted to convert it to palindrome. Before we go… Read More »

## Maximum Subarray Sum using Divide and Conquer algorithm

You are given a one dimensional array that may contain both positive and negative integers, find the sum of contiguous subarray of numbers which has… Read More »

## Maximum sum rectangle in a 2D matrix | DP-27

Given a 2D array, find the maximum sum subarray in it. For example, in the following 2D array, the maximum sum subarray is highlighted with… Read More »

## Largest Independent Set Problem | DP-26

Given a Binary Tree, find size of the Largest Independent Set(LIS) in it. A subset of all tree nodes is an independent set if there… Read More »

## Efficient program to print all prime factors of a given number

Given a number n, write an efficient function to print all prime factors of n. For example, if the input number is 12, then output… Read More »