• Post Reply Bookmark Topic Watch Topic
  • New Topic

Sorting a Vector

 
John Spindler
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody!,
I have two Vectors, one is full of Strings (customer descriptions) the other is full of Customer Numbers. The indexes on them are in sinc so If I call custNum[0] and custDesc[0] I get the customer number and description for the that customer. Here is my problem, boss wants them sorted. How can I sort one vector without having the other become offset? Also If I can only do it with one, how can I sort the String Vector Alphabetically?
Thanks for all your help,
John
 
John Spindler
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nevermind I got it, I made a Map (TreeMap) and added the elements from the Vector to the Key+Value maps then iterated through it .
Thanks.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!