简体   繁体   中英

Sort int-arraylist like other int-arraylist (not same indexOf values)

I am new here please be patient with me. I found many answers to my question but not exactly what i am looking for.

My first Array<Integer> is: ["0","1","53","14","3"]

My second Array<Integer> is: ["53","1","3"]

How can I sort the second array like the first? It should be: second-array sorted: ["1","53","3"] ?

Thank you very much! Have a nice day

List1:(0,1,53,14,3)

List2:(53,1,3)

在此处输入图片说明

sort index:

在此处输入图片说明

you can get the sorted List2:(1,53,3);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM