he "i++" "j--" expressions are just to skip the sticks[left] and find
the right position for it, so I don't think that's a weak point.
Also, all cases have passed under my program. Everything proves ok
logically and practically. That's what is anonying me.
adak wr
Thanks, but it seems not a problem.
if(ihttp://groups.google.com/group/algogeeks
-~--~~~~--~~--~--~---
Following is a qsort() program, I checked it carefully severally times
and tested with a lot of cases without finding any error. But when I
submit the program using it to online judge, it always "wrong answer",
if I substitute it with the standard qsort() of c library, it will
pass.
I post it here
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 wh
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
suppose a number sequence, for example:
4, 1, 5, 9, 2, 3
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.
sm1664809pyd.2006.05.19.20.38.08;
Fri, 19 May 2006 20:38:09 -0700 (PDT)
Message-ID: <[EMAIL PROTECTED]>
Date: Sat, 20 May 2006 11:42:16 +0800
From: "Thomas.Chang" <[EMAIL PROTECTED]>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050927
Debian/1.7.8-1sarge3
X-Acc
The main() is just an entry to a program, telling the computer to
execute right here.
So if you can tell the CPU in other ways, you can abandon main().
That's why when computer starts, POST will be triggered, CPU just fetch
the first instruction from bios and execute.
deepblue wrote:
>Hi Arul
if(!ptr)
return;
printf("%d", ptr);
}
}
}
}
Thomas.Chang
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post