Continuing the discussion from Storing empty array in Attribute Dictionaries:
The Ruby core Array#sort method ? It also takes a block where you can code a custom sorting algorithm.
Yea, that’s a bit vague. What are the keys ? If the numeric values are the hash values, then are the keys going to just be integers? If so, there is no need for a separate hash since you sorted the array and access by integer index is built-in.