Hi Rinku,

Now I could try and explain this in my own words but I think this will help
you a lot more.

http://www.unix.org.ua/orelly/perl/advprog/ch02_02.htm

What you are looking for is a very common thing, your not the first to bump
into this problem :-)

Regards,

Rob



On 12/12/06, Rinku Mahesh <[EMAIL PROTECTED]> wrote:

Hi,

    I've two arrays of same depth (let it be 6)

1st Array:-  @unique {11 , 23, 44, 66, 900, 1009}
2nd Array:- @occ_count {2, 77, 22, 2, 77,29}

Here I'm looking for a sorting mechanism with the following conditions:-

a. Sort 2nd Array in descending order such that it should reflect
{77,77,29,22,2,2}

b. The values of 1st array should also change in accordance with the
positions of elements of 2nd array such that sorting the 1st array should
reflect {23,900,1009,44,11,66}

23 and 900 or 11 and 66 can be interchanged but whatever value is lesser
should appear first in the list.

c. As there are repeatations in 2nd Array (77 and 2) there could be two
values associated with these elements in 1st array (23/900 or 11/66). Here
23 is lesser than 900 thus it should appear fist in the list.


If the above explaination is confusing I'm looking for a way where every
element of an array can be mapped to corresponding element of another array
and as a whole both the arrays require a sorting w.r.t. 2nd array.


Can anyone suggest an eficient way to implement same.

TIA,

Rinku



---------------------------------
Everyone is raving about the all-new Yahoo! Mail beta.

Reply via email to