Re: [algogeeks] MS Question: Segregrate positive and negative nos in array without changing order

2012-07-02 Thread atul anand
@amol : even if your algo wont work for this...until and unless you use extra space... but your sorting algo is not working. On Sun, Jul 1, 2012 at 11:08 PM, Amol Sharma amolsharm...@gmail.com wrote: i think it has been discussed beforenevertheless here is the required linear time

Re: [algogeeks] MS Question: Segregrate positive and negative nos in array without changing order

2012-07-02 Thread Hassan Monfared
I think O(N) space or O(nlogn) [stable nlogn sort : like stable merge sort ) time is required. ( I provided O(n^2) time and O(1) space before ) On Mon, Jul 2, 2012 at 10:24 AM, atul anand atul.87fri...@gmail.com wrote: @amol : even if your algo wont work for this...until and unless you use

Re: [algogeeks] MS Question: Segregrate positive and negative nos in array without changing order

2012-07-02 Thread Amol Sharma
@atul... can u point out where sorting is not working ? any case ? -- Amol Sharma Final Year Student Computer Science and Engineering MNNIT Allahabad http://gplus.to/amolsharma99

[algogeeks] Re: adobe

2012-07-02 Thread Rishabh Agarwal
nrows: number of rows ncols: number of columns int **arra = (int **)malloc( sizeof(int*) * nrows ); int *ar = (int *)malloc( sizeof(int) * nrows * ncols ); for( int a = 0; a nrows; a ++ ) { arra[a] = ar + ncols * a; } now index of array i and j can be

Re: [algogeeks] MS Question: Segregrate positive and negative nos in array without changing order

2012-07-02 Thread atul anand
@amol : #includestdio.h int main() { int arr[]={5,0,1,2,6,7,8,3,4,9}; int i,j,n,temp; n=sizeof(arr)/sizeof(arr[0]); for(j=0;j=1;j++) { for(i=0;in;i++) { if(arr[i]!=i){ temp=arr[i]; arr[i]=arr[arr[i]];

Re: [algogeeks] MS Question: Segregrate positive and negative nos in array without changing order

2012-07-02 Thread Amol Sharma
i don't see any change in the code you posted...other than expanding swap function i believe in discussing the idea/algonot the code.. -- Amol Sharma Final Year Student Computer Science and Engineering MNNIT Allahabad http://gplus.to/amolsharma99

Re: [algogeeks] MS Question: Segregrate positive and negative nos in array without changing order

2012-07-02 Thread atul anand
yes it is same and it not working . Apart for this you had provided code for sorting O(n) time and not the idea/algo. please explain the algorithm , how you are sorting it within O(n) time and O(1) space complexity. On Mon, Jul 2, 2012 at 3:18 PM, Amol Sharma amolsharm...@gmail.com wrote: i

Re: [algogeeks] MS Question: Segregrate positive and negative nos in array without changing order

2012-07-02 Thread atul anand
opssyeah dat was the bug... now got it :) On Mon, Jul 2, 2012 at 4:08 PM, Amol Sharma amolsharm...@gmail.com wrote: @atul: the logic for the O(n) counting is same as for the count sort. you haven't write the swap function correctly, here is correct code for swap function --

[algogeeks] Code for simulating NFA

2012-07-02 Thread Decipher
Hi, I need code to convert Regular Expression to NFA and then check whether it accepts an input string or not. Please help !! -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit

[algogeeks]

2012-07-02 Thread Pradip Singh
3 8 12 17 22 28 35 .. find the nth term of the sequence -- pardeep kumar -- 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 from this group, send email to

Re: [algogeeks]

2012-07-02 Thread sarthak rai
can we have some more terms???cant identify any pattern in this??? On Mon, Jul 2, 2012 at 8:55 PM, Pradip Singh qnit...@gmail.com wrote: 3 8 12 17 22 28 35 .. find the nth term of the sequence -- pardeep kumar -- You received this message because you are subscribed to the Google