This is a well-known problem called "Perfect Shuffle" which has been discussed here before. You should be able to find it with a search.
Gene On Aug 1, 4:15 am, Abhishek Gupta <[email protected]> wrote: > A is an array of size 2n such that first n elements are integers in any > order and last n elements are characters. > i.e. A={i1 i2 i3 ....in c1 c2 c3... cn} > then we have to rearrange the elements such that final array is > A ={ i1 c1 i2 c2 ...... in cn} > > Example : > input : A ={ 5,1,4,d,r,a}; > output : A= {5,d,1,r,4,a}; > > -- > Abhishek Gupta > MCA > NIT Calicut > Kerela -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
