in reply to Re^2: What makes an array sorted and a hash unsorted?
in thread What makes an array sorted and a hash unsorted?
The point isn't that there is a way to sort them. It's whether you need to use it to guarantee the order you get: With an array you don't, with a hash you do.
And yes, may. But the point is on the array the order will not. You can be sure of that: That given the same input, you will get the same output. A hash intentionally does not guarantee that.
And no, sorting the keys does not make the hash sorted. It simply means you have a sorted array that can be used to access the hash in a sorted order.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: What makes an array sorted and a hash unsorted?
by ikegami (Patriarch) on Jun 01, 2009 at 17:25 UTC |