Welcome To Tutorialspoint.dev
Officially launched 18th May 2019
Matrix Stack Amazon

The Celebrity Problem

In a party of N people, only one person is known to everyone. Such a person may be present in the party, if yes, (s)he doesn’t know anyone in the party. We can...
C C-Input and Output Quiz c-input-output

Problem with scanf() when there is fgets()/gets()/scanf() after it

Consider below simple program in C. The program reads an integer using scanf(), then reads a string using fgets(). // C program to demonstrate the problem w...
Dynamic Programming Amazon Codenation

Box Stacking Problem DP-22

You are given a set of n types of rectangular 3-D boxes, where the i^th box has height h(i), width w(i) and depth d(i) (all real numbers). You want to create a stack ...
Dynamic Programming Adobe Amazon

Partition problem DP-18

Partition problem is to determine whether a given set can be partitioned into two subsets such that the sum of elements in both subsets is same. Examples: arr[] = {1...
Dynamic Programming Tree Dynamic Programming

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 is no edge between any two nodes o...
Dynamic Programming Microsoft Microsoft

Word Wrap Problem DP-19

Given a sequence of words, and a limit on the number of characters that can be put in one line (line width). Put line breaks in the given sequence such that the lines...
Arrays Dynamic Programming Adobe

Subset Sum Problem DP-25

Given a set of non-negative integers, and a value sum, determine if there is a subset of the given set with sum equal to given sum. Example: Input: set[] = {3, 34, ...
Dynamic Programming Google IBM

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. See following exam...
Greedy Activity Selection Problem Amazon

Activity Selection Problem Greedy Algo-1

Greedy is an algorithmic paradigm that builds up a solution piece by piece, always choosing the next piece that offers the most obvious and immediate benefit. Greedy...
Backtracking Mathematical Amazon

The Knight’s tour problem Backtracking-1

Backtracking is an algorithmic paradigm that tries different solutions until finds a solution that “works”. Problems which are typically solved using ba...

Subscribe to Our Newsletter