Is the indexing correct ? For eg a1,a2,a3,b1,b2,b3,c1,c2,c3 for a2 the correct position is 3 but acc to the given formula it is 2.
On Oct 17, 9:35 pm, Navneet <navneetn...@gmail.com> wrote: > Great explanation Sunny. But with this approach, won't a single pass > suffice? > > Select a card , find it's new position, insert the card at that > position, > initialize i to the position of the replaced card > repeat till all cards have been processed. > > The thing we need to remember is whether relative to the new position > of the current card, the previous insertion was before or after the > newly computed position. Please comment. > > On Oct 16, 3:36 am, sravanreddy001 <sravanreddy...@gmail.com> wrote: > > > > > > > > > cheers.. > > clear explanation. thanks for the effort.. :) > > > so.. we swap 3 elements and.. run for one complete cycle of N/3 time in > > this prob.. > > > Anika has a recusion of N/3 depth.. may be.. a loop that runs N/3 time > > should suffice. > > > :) -- 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.