## 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 »

- Optimal Strategy for a Game | Set 2
- Samsung Interview Experience through Co-cubes (2019)
- Maximum sum such that no two elements are adjacent | Set 2
- Bellman Ford Algorithm (Simple Implementation)
- Longest subsequence such that adjacent elements have at least one common digit
- Double Knapsack | Dynamic Programming
- Coin Change | BFS Approach
- Minimum time required to rot all oranges | Dynamic Programming
- Partition an array of non-negative integers into two subsets such that average of both the subsets is equal
- Longest path in a directed Acyclic graph | Dynamic Programming
- Number of subsets with zero sum
- Minimum number of cubes whose sum equals to given number N
- Maximum sum combination from two arrays
- Count of integers of length N and value less than K such that they contain digits only from the given set
- LCA in a tree using Binary Lifting Technique
- Minimum cost to reach end of array array when a maximum jump of K index is allowed
- Maximize the happiness of the groups on the Trip
- Count number of ways to reach a given score in a Matrix
- Maximum Sum Subsequence of length k
- Maximum sum path in a matrix from top to bottom and back
- Flip minimum signs of array elements to get minimum sum of positive elements possible
- Distinct palindromic sub-strings of the given string using Dynamic Programming
- Find the number of binary strings of length N with at least 3 consecutive 1s
- Greedy approach vs Dynamic programming
- Maximum subarray sum by flipping signs of at most K array elements
- Iterative approach to print all permutations of an Array
- Divide the array in K segments such that the sum of minimums is maximized
- Count pairs of non-overlapping palindromic sub-strings of the given string
- Minimum steps to delete a string by deleting substring comprising of same characters
- Number of ways to choose elements from the array such that their average is K

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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

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 »

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

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 »

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 »

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 »

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 »

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 »