I have an ArrayList
which its elements are an Array
. What I want to do is to sort this ArrayList
using elements of Array
. To clarify, let's suppose we have the following arraylist:
arraylist{[10,2], [6,3], [12,2]}
Then I want to sort it in descending order using dividing each elements of arrays to each other(array a_i = [a_i,b_i] ==> sort using max(a_i/b_i)
), i.e., in the following form:
arraylist{[12,2],[10,2],[6,3]}
I tried using Sort()
, but it is for a list not for an ArrayList
as I know. Would anyone please let me know how I could sort it in an efficient way to avoid a high complexity?
Thanks!