how to sort parallel arrays in c++?

From: Xiaozhu (gee.ygary3_at_gmail.com)
Date: 08/31/04


Date: 31 Aug 2004 09:53:40 -0700

say, if you had parallel arrays containing the sales person id, the month, and
the sales figures (for that person in that month), sorting on sales figure and
preserve the order of figures within the data about the same person:
 
    Original Data:
           id month sales
        +-----+ +-----+ +-----+
        | 432 | | 8 | | 89 |
        +-----+ +-----+ +-----+
        | 123 | | 8 | | 116 |
        +-----+ +-----+ +-----+
        | 555 | | 8 | | 203 |
        +-----+ +-----+ +-----+
        | 432 | | 9 | | 105 |
        +-----+ +-----+ +-----+
        | 123 | | 9 | | 143 |
        +-----+ +-----+ +-----+
        | 555 | | 9 | | 187 |
        +-----+ +-----+ +-----+
 
    Sorted by sales:
           id month sales
        +-----+ +-----+ +-----+
        | 432 | | 8 | | 89 |
        +-----+ +-----+ +-----+
        | 432 | | 9 | | 105 |
        +-----+ +-----+ +-----+
        | 123 | | 8 | | 116 |
        +-----+ +-----+ +-----+
        | 123 | | 9 | | 143 |
        +-----+ +-----+ +-----+
        | 555 | | 9 | | 187 |
        +-----+ +-----+ +-----+
        | 555 | | 8 | | 203 |
        +-----+ +-----+ +-----+
 
is that possible to do this in c++? Thanks!



Relevant Pages

  • Re: Im Back
    ... but thats only because it sold like hotcakes last time. ... what passes for "sales". ... charts or sales figures when Michael Jackson prevented returns from ... music is just another consumerism probably more than 90% by volume. ...
    (alt.guitar)
  • Re: Im Back
    ... but thats only because it sold like hotcakes last time. ... what passes for "sales". ... charts or sales figures when Michael Jackson prevented returns from ... music is just another consumerism probably more than 90% by volume. ...
    (alt.guitar)
  • Re: Adding up ranges of numbers...
    ... > I have a spreadsheet of numbers... ... > stores.. ... with each row being a store, and each column being the sales ...
    (microsoft.public.excel)
  • Re: Spider-Man 558
    ... The new Harry seems very early Lex like. ... If this was the best of BND, ... drastic sales drops cause I'm hearing differently...Proof please.. ... let's ignore the sales figures and go on 'what you've heard'. ...
    (rec.arts.comics.marvel.universe)
  • Re: how to sort parallel arrays in c++?
    ... > say, if you had parallel arrays containing the sales person id, the month, ... > the sales figures, ... > Original Data: ...
    (comp.lang.cpp)