steps: 1.calculate the no of terms. 2.if no of terms is even then dont add dummy but if no of term is odd then add a dummy element in add like a[n]=0. 3.then sort the array. 4.And then odd no are insert in one array and even no array in the 2nd array.
On Sat, May 7, 2011 at 8:23 PM, MANNU <manishkr2...@gmail.com> wrote: > Steps to follow: > 1.Sort the given array. > 2.Partition each consecutive element in 2 arrays i.e. if 1st element is in > 1st array then second will be 2nd array and 3rd in 1st. > > > But for equal no. of elements you have to check for no. of elements in the > array. If they are odd either insert a dummy elemnt > of value 0 else output an error message (whatever you feel better). > > -- > 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 > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- 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 algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.