[algogeeks] Re: a problem

2006-06-17 Thread Thomas.Chang
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,

[algogeeks] Re: mutual exclusion algorithm problem

2006-06-17 Thread Bjorn
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

[algogeeks] Re: a problem

2006-06-17 Thread KS
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

[algogeeks] Help me with this problem

2006-06-17 Thread Norbert
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

[algogeeks] Re: Help me with this problem

2006-06-17 Thread prashant bhargava
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

[algogeeks] Re: Help me with this problem

2006-06-17 Thread Norbert
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

[algogeeks] Re: Help me with this problem

2006-06-17 Thread Norbert
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

[algogeeks] Re: Help me with this problem

2006-06-17 Thread prashant bhargava
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

[algogeeks] Re: a problem

2006-06-17 Thread Thomas.Chang
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

[algogeeks] Re: a problem

2006-06-17 Thread Googmeister
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