Greedy algorithm can only get the optimal solution, can it give a
correct one?
the optimal solution is not the best fit.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group,
this may be a lead, but it doesn't answer the initial question:
is it now mutual exclusive? deadlock free? both?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send
the task is to devide it into as less groups as possible so that in
each group the numbers are sorted incrementally without changing the
original order.
for example, the above sequence can be devided into:
4, 5, 9,
1, 2, 3
2 groups in all.
Sort the original sequence and find the longest
I'm unable to solve this problem correctly. Please help me:
You have chess board of size N x M and a lot of bricks of size K x 1.
How many bricks can you place on this board (brick edges must be
pallarel to board edges)
Thanks for help
--~--~-~--~~~---~--~~
You
if the question is complete then the answer shd' be (N/K) * M bricksam i right??On 6/17/06, Norbert
[EMAIL PROTECTED] wrote:I'm unable to solve this problem correctly. Please help me:
You have chess board of size N x M and a lot of bricks of size K x 1.How many bricks can you place on this board
Sorry, you're wrong. Consider board of size N = 1, M = 5 and K = 2.
If you round down (N/K) then you have RESULT = 0. If you round up then
you have 5. Also wrong.
On 6/17/06, prashant bhargava [EMAIL PROTECTED] wrote:
if the question is complete then the answer shd' be (N/K) * M bricks
am i
There's another example if you use floating point arithmetic. N = 10,
M = 10, K = 4. Correct answer is 24, not 25
On 6/17/06, Norbert [EMAIL PROTECTED] wrote:
Sorry, you're wrong. Consider board of size N = 1, M = 5 and K = 2.
If you round down (N/K) then you have RESULT = 0. If you round up
Could u plz explain how u r getting the answer 24 (for ur 2nd reply) ?? I really didn't understand.plz explainOn 6/17/06, Norbert
[EMAIL PROTECTED] wrote:There's another example if you use floating point arithmetic. N = 10,
M = 10, K = 4. Correct answer is 24, not 25On 6/17/06, Norbert [EMAIL
I find that the common solution is to find the LIS (longest incremental
sequence) repeatedly. Generally it's a little complex. My solution is
as follows:
maintain a group array, in which each element is the last one in that
group(sequence);
for a new one, we just find the largest group element
Thomas.Chang wrote:
I find that the common solution is to find the LIS (longest incremental
sequence) repeatedly. Generally it's a little complex. My solution is
as follows:
maintain a group array, in which each element is the last one in that
group(sequence);
for a new one, we just find
10 matches
Mail list logo