On 5/7/07, Nisha Subramanian < [EMAIL PROTECTED]> wrote:
>
> Okie... if not O(n) how can u solve it in min order ..at any cost it
> shouldn't turn out to be an infinite order.Is their any way Now?
>
> On 5/7/07, arun kumar manickan <[EMAIL PROTECTED]> wrote:
> >
we can use a modified binary search to find the element.
whenever u calculate a new lower and upper boundary you can move them
forward and backward respectively so that both point to a index which
contains a valid number.But still this wont give O(n).
do we have any memory constraints?
do we have
interesting solution really.
but the order of the algorithm seems to be n^2 / 4 . [ as we will look at n/2 elements each time and swap them, and repeating this for n/2 times ]
please correct me if I am wrong.
thanks.
--~--~-~--~~~---~--~~
You received this me
my idea,
say, fruit1 is required to make person A and person B happy.
person A requires num1 number of fruit1 and person B requires num2 number of fruit1.
then required number of fruit1 is max( num1 , num2 )
similary if you can extend this to all who require it and calculate the max require
Hi,
We can make the following observations :
1) Both arrays A and B should have same no of elements
2) First element of both A and B should be the same
3) All elements less than the first element in array A should come in the same order in array B also.
4) All elements less than the second elem
DFS on a BST = it pre order traversal ..
is this correct ?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com To unsubscribe fro