Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged knapsack-problem
0
votes
1
answer
1
Dynamic Programming
int max(int a, int b) { return (a > b) ? a : b; } // Returns the maximum value that can be // put in a knapsack of capacity W int knapSack(int W, int wt[], int val[], int n) { // Base Case if (n == 0 || W == 0) return 0; // If ... , wt, val, n - 1), knapSack(W, wt, val, n - 1)); } This statement implies that the max value return by the two different recursive problems right?
int max(int a, int b) { return (a b) ? a : b; }// Returns the maximum value that can be// put in a knapsack of capacity Wint knapSack(int W, int wt[], int val[], int n){...
ryandany07
825
views
ryandany07
asked
Aug 18, 2022
Algorithms
algorithms
dynamic-programming
knapsack-problem
+
–
0
votes
1
answer
2
#aktu #aktu 2016-17
please provide the solution
please provide the solution
Nitesh_Yadav
628
views
Nitesh_Yadav
asked
Dec 29, 2021
Algorithms
algorithms
knapsack-problem
+
–
0
votes
1
answer
3
Applied Test Series
Consider the following items with their associated weights and values. If a knapsack of capacity 25 units of weight is available and we are allowed to take either the item completely or leave it the maximum possible profit if we follow the greedy approach by being greedy about profit is _____
Consider the following items with their associated weights and values. If a knapsack of capacity 25 units of weight is available and we are allowed to take either the ite...
LRU
1.6k
views
LRU
asked
Dec 28, 2021
Algorithms
test-series
knapsack-problem
algorithms
greedy-algorithm
+
–
0
votes
1
answer
4
Applied Test Series: Knapsack Problem
The following table givens the frequency of 4 letters in a database of text If Huffman encoding is used to encode the word “aaabca” the number of bits required for it is given by ______. Need help!
The following table givens the frequency of 4 letters in a database of textIf Huffman encoding is used to encode the word “aaabca” the number of bits required for it ...
ramakrushna
546
views
ramakrushna
asked
Dec 25, 2021
Operating System
test-series
knapsack-problem
algorithms
+
–
0
votes
1
answer
5
Testbook Test Series
rsansiya111
329
views
rsansiya111
asked
Dec 17, 2021
Algorithms
testbook-test-series
greedy-algorithm
knapsack-problem
+
–
1
votes
1
answer
6
NIELIT Scientific Assistant A 2020 November: 64
Which of the following is a correct time complexity to solve the $0/1$ knapsack problem where $n$ and $w$ represents the number of items and capacity of knapsack respectively? $O(n)$ $O(w)$ $O(nw)$ $O(n+w)$
Which of the following is a correct time complexity to solve the $0/1$ knapsack problem where $n$ and $w$ represents the number of items and capacity of knapsack respecti...
gatecse
668
views
gatecse
asked
Dec 9, 2020
Algorithms
nielit-sta-2020
algorithms
dynamic-programming
easy
knapsack-problem
time-complexity
+
–
2
votes
2
answers
7
NIELIT 2016 DEC Scientist B (CS) - Section B: 7
The Knapsack problem belongs to which domain of problems? Optimization NP complete Linear Solution Sorting
The Knapsack problem belongs to which domain of problems?OptimizationNP completeLinear SolutionSorting
admin
8.6k
views
admin
asked
Mar 31, 2020
Algorithms
nielit2016dec-scientistb-cs
algorithms
knapsack-problem
algorithm-design-technique
+
–
1
votes
2
answers
8
NIELIT 2017 July Scientist B (IT) - Section B: 60
$0/1$-Knapsack is a well known problem where, it is desired to get the maximum total profit by placing $n$ items (each item is having some weight and associated profit) into a knapsack of capacity $W$. The table given below shows the weights and associated ... $19$ $18$ $17$ $20$
$0/1$-Knapsack is a well known problem where, it is desired to get the maximum total profit by placing $n$ items (each item is having some weight and associated profit) i...
admin
2.7k
views
admin
asked
Mar 30, 2020
Algorithms
nielit2017july-scientistb-it
algorithms
greedy-algorithm
knapsack-problem
+
–
0
votes
0
answers
9
self doubt *0/1 knapsack problem*
In 0/1 knapsack problem ,suppose if maximum weight is given as W and we are asked to find out max profit then * IS IT NECESSARY THAT THE TOTAL WEIGHT SHOULD BE EXACTLY EQUAL TO W OR IT CAN BE LESS THAN W AS WELL????
In 0/1 knapsack problem ,suppose if maximum weight is given as W and we are asked to find out max profit then * IS IT NECESSARY THAT THE TOTAL WEIGHT SHOULD BE EXACTLY EQ...
karan25gupta
689
views
karan25gupta
asked
Apr 17, 2019
Algorithms
algorithms
dynamic-programming
knapsack-problem
+
–
0
votes
1
answer
10
self doubt
Can we solve fractional knapsack using dynamic programming?
Can we solve fractional knapsack using dynamic programming?
DIYA BASU
498
views
DIYA BASU
asked
Feb 14, 2019
Algorithms
knapsack-problem
dynamic-programming
+
–
0
votes
0
answers
11
self_doubt
Is there any better approach to solve 0/1 knapsack problem other than tabular method ? as it consumes a lot of time when greater number of objects are given.
Is there any better approach to solve 0/1 knapsack problem other than tabular method ? as it consumes a lot of time when greater number of objects are given.
Shivam Kasat
426
views
Shivam Kasat
asked
Jan 8, 2019
Algorithms
algorithms
knapsack-problem
+
–
0
votes
1
answer
12
MadeEasyAlgo
Maximum profit using 0/1 Knapsack with W=200 is there any other than brute force method to solve this??? or we have to do only with tabular method?please solve and mention the way that is efficient w.r.t time if any.
Maximum profit using 0/1 Knapsack with W=200 is there any other than brute force method to solve this??? or we have to do only with tabular method?please solve and mentio...
Abhisek Tiwari 4
611
views
Abhisek Tiwari 4
asked
Dec 24, 2018
Algorithms
algorithms
dynamic-programming
knapsack-problem
numerical-answers
made-easy-booklet
+
–
0
votes
1
answer
13
Dynamic Programming
What is the best way to solve a 0/1 knapsack problem? Any trick to solve it without wasting much time? Not How to
What is the best way to solve a 0/1 knapsack problem? Any trick to solve it without wasting much time?Not How to
CJ147
432
views
CJ147
asked
Dec 3, 2018
Algorithms
dynamic-programming
knapsack-problem
+
–
1
votes
1
answer
14
ACE TEST SERIES QUESTION
Shankar Kakde
365
views
Shankar Kakde
asked
Oct 1, 2018
Algorithms
knapsack-problem
algorithms
ace-test-series
+
–
0
votes
0
answers
15
Self doubt
How to solve fractional knapsack problem using heap ?
How to solve fractional knapsack problem using heap ?
Prince Sindhiya
179
views
Prince Sindhiya
asked
Jul 22, 2018
Algorithms
algorithms
knapsack-problem
+
–
0
votes
1
answer
16
Time complexity analysis
What will be the time complexity if fractional knapsack is implemented using min heap instead of sorted array a) O(nlogn) b)O(n^2) c)O(n) d) none of these
What will be the time complexity if fractional knapsack is implemented using min heap instead of sorted arraya) O(nlogn)b)O(n^2)c)O(n)d) none of these
Rohit Pandey
788
views
Rohit Pandey
asked
Jun 27, 2018
Algorithms
time-complexity
knapsack-problem
sorting
binary-heap
+
–
0
votes
1
answer
17
Fractional Knapsack
Is fractional Kanpsack or knapsack problem in our GATE 2019 Syllabus
Is fractional Kanpsack or knapsack problem in our GATE 2019 Syllabus
Na462
647
views
Na462
asked
Apr 30, 2018
Algorithms
knapsack-problem
+
–
0
votes
0
answers
18
General Topic Doubt: Algorithms - Dynamic Programming
Read the following statements about 0/1 Knapsack problem. (i) Time complexity of Knapsack is O(n* W) where W is the weight of the Knapsack and there are n items. (ii) Time complexity of Knapsack is min( O(n*W) , O(2^n) ) where W is the weight of the ... ) and (iii) is true (ii) and (iii) is true (i) ( iii) (iv) is true (ii) (iii) (iv) is true.
Read the following statements about 0/1 Knapsack problem.(i) Time complexity of Knapsack is O(n* W) where W is the weight of the Knapsack and there are n items.(ii) Time ...
VIKAS TIWARI
1.0k
views
VIKAS TIWARI
asked
Dec 13, 2017
Algorithms
algorithms
dynamic-programming
knapsack-problem
general-topic-doubt
+
–
0
votes
1
answer
19
Knapsack
The following Knapsack bag. The Knapsack bag maximum Capacity is 50. Find out the maximum profit for Fractional Knapsack. P Q R S T U V W Weight 18 12 16 14 16 20 10 15 Profit 34 15 22 16 17 22 18 26 90 80.25 85.50 91.2
The following Knapsack bag. The Knapsack bag maximum Capacity is 50. Find out the maximum profit for Fractional Knapsack. PQRSTUVWWeight1812161416201015Profit341522161722...
Parshu gate
8.3k
views
Parshu gate
asked
Nov 16, 2017
Algorithms
algorithms
greedy-algorithm
knapsack-problem
+
–
1
votes
0
answers
20
techtud
In the knapsack problem we are given a set of n items, where each item i is specified by a size si and a value vi. We are also given a size bound S (the size of our knapsack). The goal is to find the subset of items of maximum total value such that sum of their sizes is at ... needed. It is already complete algorithm. (B) arr[S][n]= result; (C) arr[n][n]= result; (D) arr[n][S] = result;
In the knapsack problem we are given a set of n items, where each item i is specified by a size si and a value vi. We are also given a size bound S (the size of our knaps...
Manoja Rajalakshmi A
518
views
Manoja Rajalakshmi A
asked
Nov 7, 2017
Algorithms
knapsack-problem
algorithms
+
–
2
votes
1
answer
21
knapsack problem what is answer to this anyone ??
sumit goyal 1
1.1k
views
sumit goyal 1
asked
Nov 7, 2017
Algorithms
algorithms
knapsack-problem
test-series
+
–
0
votes
1
answer
22
Knapsack problem
5.Consider the Knapsack instance with 5 objects and a capacity M=11, profit P=(5,4,7,2,3) and weight W=(4,3,6,2,2.). Solve it using dynamic programming approach.
5.Consider the Knapsack instance with 5 objects and a capacity M=11, profit P=(5,4,7,2,3) andweight W=(4,3,6,2,2.). Solve it using dynamic programming approach.
Syedabbas110
2.8k
views
Syedabbas110
asked
Oct 30, 2017
Algorithms
algorithms
knapsack-problem
dynamic-programming
+
–
1
votes
1
answer
23
algorithm
how is 0/1 knapsack time complexity O(2^n/2) ?
how is 0/1 knapsack time complexity O(2^n/2) ?
A_i_$_h
329
views
A_i_$_h
asked
Jul 25, 2017
Algorithms
knapsack-problem
time-complexity
+
–
0
votes
1
answer
24
Fractional Knapsack(Greedy Method)
Consider the following instance of the knapsack problem: n=3 , W=50 , (v1,v2,v3) = (60,100,120) and weight (w1,w2,w3) = (10,20,30) . solve the given knapsack problem applying greedy algorithm.
Consider the following instance of the knapsack problem: n=3 , W=50 , (v1,v2,v3) = (60,100,120) and weight (w1,w2,w3) = (10,20,30) .solve the given knapsack problem apply...
LavTheRawkstar
3.9k
views
LavTheRawkstar
asked
Apr 15, 2017
Algorithms
algorithms
knapsack-problem
greedy-algorithm
+
–
1
votes
1
answer
25
#Confusion Is it necessary to arrange the weights in Ascending order while solving 0/1 Knapsack problem using Dynamic
Number of Cateogires are 5, Thier total weights are w1,w2,w3,w4,w5={7,2,4,8,6}b1,b2,b3,b4,b5={5,6,4,3,2}M=6=Maximum Capacity= WI am having confusion How to solve using dy...
LavTheRawkstar
2.6k
views
LavTheRawkstar
asked
Mar 25, 2017
Algorithms
knapsack-problem
algorithms
+
–
1
votes
1
answer
26
Find the Optimal Solution of Fractional Knapsack where W=15
Item Total Weight Total Profit 1 2 10 2 3 5 3 5 15 4 7 7 5 1 6 6 4 18 7 1 3 Answer is 55.33 but how?
ItemTotal WeightTotal Profit121023535154775166418713Answer is 55.33 but how?
LavTheRawkstar
7.4k
views
LavTheRawkstar
asked
Feb 28, 2017
Algorithms
algorithms
knapsack-problem
+
–
1
votes
1
answer
27
Consider the Knapsack incidence with n=3(items) with weights {w1,w2,w3}={2,3,4} and profits are {p1,p2,p3}={1,2,5}
Consider the Knapsack incidence with n=3(items) with weights {w1,w2,w3}={2,3,4} and profits are {p1,p2,p3}={1,2,5}Given the capacity is 5,{W/M = 5 } Find the optimal solu...
LavTheRawkstar
13.1k
views
LavTheRawkstar
asked
Feb 28, 2017
Algorithms
knapsack-problem
greedy-algorithm
+
–
Page:
1
2
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register