First, this reeks of a homework assignment.
Second, there is insufficient information. A hash has two components, a key and a value. Do you want the key and the value to be the same? Do you want to print the value portion of the hash sorted by the keys? Or perhaps vice versa?
Have you read the FAQ about posting, where it explains about making a question clear?