@ gopi:
I think you are referring to the even number of elements in the list.
Anyhow, here is the solution to the odd number of elements.
http://ideone.com/5nmzL
Now is the problem solved?
On 20 August 2011 10:47, *$* wrote:
> Hi,
> But as per the given problem , that constraint is not specifi
Hi,
But as per the given problem , that constraint is not specified..
thx,
--Gopi
On Sat, Aug 20, 2011 at 9:25 AM, Dipankar Patro wrote:
> Fixed the problem. There was a problem with the first element positioning.
>
> Here is the final solution:
> http://ideone.com/XwymV
>
> ^^ Time complexity
Hello all
I have just joined the group and I am happy that I took this decision..:)
However I want to direct all the mails from the group to another id that I
made specifically for this group..but it is not showing the email id in the
drop down box in the setting ...Please help
Cosmexia
On
Fixed the problem. There was a problem with the first element positioning.
Here is the final solution:
http://ideone.com/XwymV
^^ Time complexity - O(2n)
Space complexity O(1)
:)
On 20 August 2011 08:14, Dipankar Patro wrote:
> http://ideone.com/ucO4d
>
> Total no. of elements should be even (
http://ideone.com/ucO4d
Total no. of elements should be even (I assume) and it is also failing for
some test cases. Working on to zero down to the error in algo.
On 20 August 2011 02:11, JAIDEV YADAV wrote:
> this was earlier in this group...
> Please see this paper: http://j.mp/rtNp4W
>
>
> On
this was earlier in this group...
Please see this paper: http://j.mp/rtNp4W
On Fri, Aug 19, 2011 at 2:40 PM, Abhishek Yadav wrote:
> Its the same as we do merge sort where we merge the two sorted array into
> one which will require an extra array..
> Is there any algorithm for inplace merges
@ *$* : would you elaborate more on the problem ?
Because when the array will be simply sorted, even then the problem looks to
be solved.
I think we required something else that is not clear from the statement.
*Regards
Sanju
Happy to Help :)*
On Fri, Aug 19, 2011 at 2:10 AM, Abhishek Yadav
Its the same as we do merge sort where we merge the two sorted array into
one which will require an extra array..
Is there any algorithm for inplace mergesort...?
On Fri, Aug 19, 2011 at 2:09 PM, sagar pareek wrote:
> Can be done in O(n) time but it will need O(n) space too
>
> take another
Can be done in O(n) time but it will need O(n) space too
take another array of same length
then its code will be
for( i=0,j=0,k=n/2+1 ;i<=n/2&&karr[k])
new[j++]=arr[k++];
else
new[j++]=arr[i++];
}
if(k wrote:
> Sort an array of n positive integers containing n/2 sorted integers in
>
Sort an array of n positive integers containing n/2 sorted integers in first
and second-half?
in O(n) time complexity ..
and space complexity should be constant
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email
10 matches
Mail list logo