Tag Archives: knapsack

There are some processes that need to be executed. The amount of load that process causes a server that runs it, is being represented by… Read More
Given an array arr[], consisting of N non-negative integers and an integer S, the task is to find the number of ways to obtain the… Read More
Pre-requisite: Fractional Knapsack Problem Given two arrays weight[] and profit[] the weights and profit of N items, we need to put these items in a… Read More
Given N items with weights W[0..n-1], values V[0..n-1] and a knapsack with capacity C, select the items such that: The sum of weights taken into… Read More
Given S stacks of length M, the task is to maximize the sum of elements at the top of each stack by popping at most… Read More
Given N items, each item having a given weight Ci and a profit value Pi, the task is to maximize the profit by selecting a… Read More
Given weights and profits of N items, put these items in a knapsack of capacity W. The task is to print all possible solutions to… Read More
Given a knapsack with capacity C and two arrays w[] and val[] representing the weights and values of N distinct items, the task is to… Read More
Given an integer array, consisting of positive weights “W” and there values “V” respectively as a pair and some queries consisting of an integer ‘C’… Read More
Given weights and values of n items, the task is to put these items in a knapsack of capacity W to get the maximum total… Read More
Given an array of positive elements, you have to flip the sign of some of its elements such that the resultant sum of the elements… Read More
A trip to mystical land is going to be organized in ByteLand, the city of Bytes. Unfortunately, there are limited seats say A and there… Read More
Given an integer array W[] consisting of weights of items and ‘K’ knapsacks of capacity ‘C’, find maximum weight we can put in the knapsacks… Read More
Given an integer array W[] consisting of weights of the items and some queries consisting of capacity C of knapsack, for each query find maximum… Read More
Given three integer n, h and p where n is the number of topics, h is the time left (in hours) and p is the… Read More