@Sunny

Your technique of Inshuffle and Outshuffle are perfect. But how to translate
into the code without using extra space or say even constant space


On Tue, Oct 18, 2011 at 12:43 AM, Dan <[email protected]> wrote:

> I have a hard copy of the book (years back,  I implemented a fortran
> version of the algorithm described in the book).  I don't know if you
> can find an online version or not.  I'm sure there is stuff there.
> Have you done a simple Google search for "in place reorder
> array"  ??   It's not a difficult algorithm.  And Sedgewicks's books
> are well known.  Searches for his name may also yield results.
>
> Just FYI:  If your rearrangement doesn't have to be in-place...  you
> will achieve more speed by other methods.  I did testing with
> rearrangement of some very large data sets.  The in-place method was
> noticeably slower.  It also required you to write your own routine to
> do the reordering.  Using basic fortran, I could do the same thing in
> just one or two lines of very simple code.  The only advantage to the
> in-place algorithm is that it uses less memory.   This should only be
> important if you are dealing with some very large arrays.
>
> Dan   :-)
>
>
> On Oct 14, 9:44 pm, Ankur Garg <[email protected]> wrote:
> > @Dan ..can you post the algo here or link to the book??
> > @Anika ...yes please post the code here..but please explain a bit about
> > underlying algo ...(algo is more important than actual code )
> >
> >
> >
> >
> >
> >
> >
> > On Sat, Oct 15, 2011 at 1:54 AM, Dan <[email protected]> wrote:
> > > On Oct 13, 7:52 pm, "shiva@Algo" <[email protected]> wrote:
> > > > Convert an array "a1 a2 a3...an b1 b2 b3...bn c1 c2 c3...cn" to
> "a1b1c1
> > > > a2b2c2...anbncn", inplace
> >
> > > See the algorithm for memory efficient rearrangement of array elements
> > > in one of the books by Robert Sedgewick such as Algorithms in C++ or
> > > Algorithms in Pascal, etc.
> >
> > > Dan
> >
> > > --
> > > 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.
>
> --
> 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.
>
>

-- 
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.

Reply via email to