index the stones 1 to 10:
suppose the list is {3,1,4,5};
so the original list looks like
1->3
2->1
3->4
4->5
Now sort the indexes based on the value of height......
2->1
1->3
3->4
4->5
Now reorder the indexes from 1 to 4.Can be implemented elegantly with C++
overloading quite elegantly.,

On Sun, Aug 21, 2011 at 12:43 AM, sagar pareek <sagarpar...@gmail.com>wrote:

> Ok u mean indirect sort ?
> In other words sort it in your mind ( in computer case sort it using
> references ) and then place them accordingly ( In computer case deference
> them just like in case of long strings sorting ? )
>
> On Sun, Aug 21, 2011 at 12:38 AM, Aditya Virmani <virmanisadi...@gmail.com
> > wrote:
>
>> use the references, sort it & then move the statues. no intermediate
>> moves...like it shudnt be.moving a to b & then to c...
>>
>>
>> On Sun, Aug 21, 2011 at 12:33 AM, sagar pareek <sagarpar...@gmail.com>wrote:
>>
>>> I am just asking what actual solution wants to convey?
>>>
>>>
>>> On Sun, Aug 21, 2011 at 12:32 AM, sagar pareek <sagarpar...@gmail.com>wrote:
>>>
>>>> *The statues are
>>>> very heavy and you want to move them the least possible distance.*
>>>>
>>>> On Sun, Aug 21, 2011 at 12:31 AM, priya ramesh <
>>>> love.for.programm...@gmail.com> wrote:
>>>>
>>>>> in quick sort the pivot is positioned to it's proper position. (no
>>>>> intermediate swaps)
>>>>>
>>>>> --
>>>>> 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.
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> **Regards
>>>> SAGAR PAREEK
>>>> COMPUTER SCIENCE AND ENGINEERING
>>>> NIT ALLAHABAD
>>>>
>>>>
>>>
>>>
>>> --
>>> **Regards
>>> SAGAR PAREEK
>>> COMPUTER SCIENCE AND ENGINEERING
>>> NIT ALLAHABAD
>>>
>>>  --
>>> 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.
>>
>
>
>
> --
> **Regards
> SAGAR PAREEK
> COMPUTER SCIENCE AND ENGINEERING
> NIT ALLAHABAD
>
>  --
> 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.
>



-- 
Saurabh Singh
B.Tech (Computer Science)
MNNIT ALLAHABAD

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

Reply via email to