impliment the selection sort algorithm to sort the elements in a two dimentional array of order 3*4 in descending order. the program should prompt the user to input 12 element, sort and display the elements in the matrix format.
tubzz
-3
Junior Poster in Training
Recommended Answers
Jump to PostWhat have you gotten done so far? After that, what is the specific problem you are having? :)
Jump to PostThe entire point of that exercise is to become familiar with the selection sort, so without actually doing it for you, try the following link to "aid" in your research and learning efforts. :)
Jump to Post2-dimension sort
- for each member of first element, sort second.
- sort each member of first element, and maintain order of second.
Enjoy!
And BTW, you have your rows (first element) and columns (second element) reversed! Your 3x4 array should be 3 rows of 4 columns, not the other way …
Jump to PostThe most important thing is to learn how to indent your code to make it easier to read. Some of the most respected responders on the site won't look at your code if yout dont' do it.
Then, it doesn't look like you have initialized the variable called position on …
All 16 Replies
plenty.groover
0
Light Poster
tubzz
-3
Junior Poster in Training
tubzz
-3
Junior Poster in Training
plenty.groover
0
Light Poster
tubzz
-3
Junior Poster in Training
rubberman
1,355
Nearly a Posting Virtuoso
Featured Poster
tubzz
-3
Junior Poster in Training
tubzz
-3
Junior Poster in Training
Lerner
582
Nearly a Posting Maven
tubzz
-3
Junior Poster in Training
tubzz
-3
Junior Poster in Training
tinstaafl
1,176
Posting Maven
tubzz
-3
Junior Poster in Training
tubzz
-3
Junior Poster in Training
tinstaafl
1,176
Posting Maven
tubzz
-3
Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.