View Single Post
Old 11-29-2004, 01:41 PM   #1 (permalink)
See Plus Plus
 
Junior Techie

Join Date: Oct 2004

Posts: 63

See Plus Plus

Question Need Help w/C++ Array Exchange Maximum Sort...

Hi everyone,

Can anyone please please please help me with this:
I need to write a source code for this - I only know how to do it for a single array (list?), but this one asks for a table. I know I have to use the exchange sort code with for loops but I can't figure it out beyond a list.

Here goes:
A 2-D array has these 20 elements:
3 33 333 3333
5 55 555 5555
1 11 111 1111
4 44 444 4444
2 22 222 2222

Write an exchange maximum program to:
a) Sort the array so that it will look like this:

5 55 555 5555
4 44 444 4444
3 33 333 3333
2 22 222 2222
1 11 111 1111

b) Sort the array so that it will look like this:

1111 111 11 1
2222 222 22 2
3333 333 33 3
4444 444 44 4
5555 555 55 5

If anyone can please help me out I would really appreciate it.
Thank you
See Plus Plus is offline