You seem to have an issue with numbers
vs resultSet
. If you pass your numbers
array as a parameter to your sorting function, it can work.
Some advice:
- pass on your
resultSet
as parameter to yourswap
function so as to maintain consistency on which array you're actually sorting - refrain from using class-scoped arrays for that kind of operations (this one is arguable and depends on your actual task)