if I already have a structure indicating the position of the element in the
array. Then why do we need to sort. Question is to provide index of element
in O(nlogn).



On Tue, Dec 28, 2010 at 2:20 PM, Wladimir Tavares <wladimir...@gmail.com>wrote:

> Hi Anad,
>
> You can create a struct with this information
>
> typedef struct TArray{
> int value;
> int index;
> };
>
> TArray a[100];
>
>
>
> Wladimir Araujo Tavares
> http://www.si.ufc.br/~wladimir <http://www.si.ufc.br/%7Ewladimir/>
> "Fiz uma faculdade! Só não fiz a segunda porque acabaram os tijolos."
>
>
>
>
>
> On Tue, Dec 28, 2010 at 1:57 PM, Anand <anandut2...@gmail.com> wrote:
>
>> Now the question boils down to how to sorted the array preserving its
>> index.
>>
>>
>> On Tue, Dec 28, 2010 at 12:27 AM, juver++ <avpostni...@gmail.com> wrote:
>>
>>> Sort first array preserving the initial position of the elements.
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algoge...@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@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 algoge...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@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 algoge...@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@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 algoge...@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