Click here to Skip to main content
15,890,438 members
Home / Discussions / Algorithms
   

Algorithms

 
SuggestionRe: Puchi and Luggage. Wrong Answer for some test cases. Pin
Richard MacCutchan1-Jun-19 21:32
mveRichard MacCutchan1-Jun-19 21:32 
QuestionWhat kind of structure can it be? Pin
Member 1447661631-May-19 0:24
Member 1447661631-May-19 0:24 
AnswerRe: What kind of structure can it be? Pin
Richard MacCutchan31-May-19 1:09
mveRichard MacCutchan31-May-19 1:09 
QuestionAlgorithm to find maximum sum in an array given that the elements have unique digits Pin
akshit bhatia28-May-19 9:02
akshit bhatia28-May-19 9:02 
AnswerRe: Algorithm to find maximum sum in an array given that the elements have unique digits Pin
Patrice T1-Jun-19 10:12
mvePatrice T1-Jun-19 10:12 
QuestionXamarin Platform Pin
Member 1447108926-May-19 5:50
Member 1447108926-May-19 5:50 
AnswerRe: Xamarin Platform Pin
OriginalGriff26-May-19 5:51
mveOriginalGriff26-May-19 5:51 
Question[solved] Find the sublist of objects with the highest value without exceeding weight limit Pin
Member 1433642827-Apr-19 2:23
Member 1433642827-Apr-19 2:23 
Hi Everyone!!

I have a list of objects, each one has a weight and a value.
So an array like this
[ [O1, V1, W1], [O2, V2, W2] ... [On, Vn, Wn]]

The goal is to get the sublist of objects with the highest value without exceeding the weight limit.
So I get an array like this
[ [O1, O2, O4, O7], V, W]
where V = V1 + V2 + V4 + V7 and W = W1 + W2 + W4 + W7
and W <= Wmax and V is the highest possible value.

Of course, I can build all the valid lists and sort them.
But it may be long!
Is there a more efficient algorithm?

Thanks everyone for your consideration!

-- modified 1-May-19 17:06pm.
AnswerRe: Find the sublist of objects with the highest value without exceeding weight limit Pin
OriginalGriff27-Apr-19 2:25
mveOriginalGriff27-Apr-19 2:25 
GeneralRe: Find the sublist of objects with the highest value without exceeding weight limit Pin
Member 1433642827-Apr-19 5:29
Member 1433642827-Apr-19 5:29 
GeneralRe: Find the sublist of objects with the highest value without exceeding weight limit Pin
ChrisFromWales1-May-19 0:09
ChrisFromWales1-May-19 0:09 
GeneralRe: Find the sublist of objects with the highest value without exceeding weight limit Pin
Member 143364281-May-19 6:49
Member 143364281-May-19 6:49 
GeneralRe: Find the sublist of objects with the highest value without exceeding weight limit Pin
Richard Deeming1-May-19 8:09
mveRichard Deeming1-May-19 8:09 
GeneralRe: Find the sublist of objects with the highest value without exceeding weight limit Pin
Member 143364282-May-19 4:19
Member 143364282-May-19 4:19 
GeneralRe: Find the sublist of objects with the highest value without exceeding weight limit Pin
Member 143364281-May-19 11:09
Member 143364281-May-19 11:09 
QuestionAlgorithm to compress Image to RGB565 for embedded screen Pin
XxKeldecknightxX24-Apr-19 8:10
XxKeldecknightxX24-Apr-19 8:10 
AnswerRe: Algorithm to compress Image to RGB565 for embedded screen Pin
Gerry Schmitz24-Apr-19 8:56
mveGerry Schmitz24-Apr-19 8:56 
GeneralRe: Algorithm to compress Image to RGB565 for embedded screen Pin
XxKeldecknightxX24-Apr-19 11:21
XxKeldecknightxX24-Apr-19 11:21 
QuestionGet all groups in 4x4 matrix with width and height of power 2 Pin
Member 142151775-Apr-19 6:59
Member 142151775-Apr-19 6:59 
GeneralRe: Get all groups in 4x4 matrix with width and height of power 2 Pin
Richard MacCutchan5-Apr-19 8:51
mveRichard MacCutchan5-Apr-19 8:51 
GeneralRe: Get all groups in 4x4 matrix with width and height of power 2 Pin
Member 142151776-Apr-19 1:26
Member 142151776-Apr-19 1:26 
GeneralRe: Get all groups in 4x4 matrix with width and height of power 2 Pin
Richard MacCutchan6-Apr-19 4:32
mveRichard MacCutchan6-Apr-19 4:32 
GeneralRe: Get all groups in 4x4 matrix with width and height of power 2 Pin
Member 142151776-Apr-19 5:18
Member 142151776-Apr-19 5:18 
AnswerRe: Get all groups in 4x4 matrix with width and height of power 2 Pin
Gerry Schmitz6-Apr-19 10:13
mveGerry Schmitz6-Apr-19 10:13 
AnswerRe: Get all groups in 4x4 matrix with width and height of power 2 Pin
Daniel Pfeffer6-Apr-19 21:16
professionalDaniel Pfeffer6-Apr-19 21:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.