Thread: ordering arrays
View Single Post
Join Date: Aug 2005
Posts: 15,171
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1439
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Most Valuable Poster

Re: ordering arrays

 
0
  #7
Nov 20th, 2008
indices is used to indirectly reference the elements of the other two arrays. IMO the best way to understand the concept is to write a small program and test it out. Sort the array then print out the values of the errors array.
  1. // assume array has been sorted per my previous post
  2. //
  3. // now just simply display the values of the errors array
  4. for(int i = 0; i < 16; i++)
  5. cout << errors[ indices[i] ] << "\n";
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote