[algogeeks] Re: How to Sort a Stack in ascending order

2006-05-06 Thread SIVA SANKARA REDDY
hi harsh, u r using merge(), which is implementaion specific!!Cheers, siva. On 5/5/06, harsh [EMAIL PROTECTED] wrote: This is clearly O(N*N)I will give you an O(N*log(N)) algorithm..Stack sort(Stack S, int N){// N is the number of elements in thestackStack s1 = new Stack();for (int i=0;iN/2;i++){

[algogeeks] Re: Given an array of size n of 0 and 1 only sort it in linear time.

2006-05-05 Thread SIVA SANKARA REDDY
Hi negi! forget abt stable sort, your code wud not even do simple sort. e.g. try your code on a[]={0,1,0} , it doesn't sort it as a[j] never a[i]. cheers, siva.On 5/5/06, Cool_Happy [EMAIL PROTECTED] wrote: i think this sort the array in linear time..if this snippet has any error do let me

[algogeeks] Fwd: Posting error: Algorithm Geeks

2006-04-23 Thread SIVA SANKARA REDDY
-- Forwarded message --From: [EMAIL PROTECTED] [EMAIL PROTECTED]Date: Apr 23, 2006 12:57 PMSubject: Posting error: Algorithm GeeksTo: [EMAIL PROTECTED]You do not have permission to post to group algogeeks. You may need to join the group before being allowed to post, or this group