Bigfoot -
You can sort a collection, but it ain't pretty. If you've got lots of memory available, just read it out of collection A into B in the order you want. If you want to do an in-place sort, then things get really ugly. You'd have to loop through the collection re-assigning the key values so that they appear in correct order. You could do an insertion sort, but modified where when you need to swap two items, you'd copy them out to temp object variables, delete the items from the collection, swap their key values, then add them back in. When you get done, you could iterate through the collection by key value to get them in ascending order.
If you don't have a copy already, pick up:
Practical Algorithms for Programmers
Paperback, 592 Pages, Edition Number 01, Addison-Wesley Longman, Incorporated, June 1995
ISBN: 020163208X
The algorithms in the book are written in C, but they're very readable, since the author doesn't do any tricks with pointers. This book is highly reccommended.
Chip H.