ArrayList~extras Class
Useful algorithms that are not provided by browsers. Available if Y.ArrayList (collection) is loaded.
Item Index
Methods
Methods
binarySearch
(
Int
-
target
Binary search, using the function passed to setComparator().
Parameters:
-
targetMixedthe object to search for
Returns:
Int:
index of matched item or -1 if no match
quickSort
()
Quick sort the given list, using the function passed to setComparator().
setComparator
(
-
compare
Set comparison function.
Parameters:
-
compareFunctionthe -1,0,+1 comparison function to use when sorting and searching
swap
(
-
i -
j
Swap two elements.
Parameters:
-
iIntfirst index
-
jIntsecond index
