Two dimensional array sorting

Reply

Join Date: Sep 2008
Posts: 40
Reputation: cutedipti is an unknown quantity at this point 
Solved Threads: 0
cutedipti cutedipti is offline Offline
Light Poster

Two dimensional array sorting

 
0
  #1
Nov 19th, 2008
H!
I have to write a program for sorting two dimensional array(e.g. Matrix) without converting it into a single dimensional array or using pointer concept. So, can u please give me any idea for writing this program?
Thanks & Regards
Ms. Dipti
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 2,001
Reputation: ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of 
Solved Threads: 343
ArkM's Avatar
ArkM ArkM is offline Offline
Postaholic

Re: Two dimensional array sorting

 
0
  #2
Nov 19th, 2008
Nobody knows what order relation for matrix are you using.
And you?
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 40
Reputation: cutedipti is an unknown quantity at this point 
Solved Threads: 0
cutedipti cutedipti is offline Offline
Light Poster

Re: Two dimensional array sorting

 
0
  #3
Nov 20th, 2008
Originally Posted by ArkM View Post
Nobody knows what order relation for matrix are you using.
And you?

Hye, that's user's choice!
Order of the matrix will be entered by the user according to his/her choice as the the matrix he/her wants to sort

Output will be as below:

Enter the order of the matrix you want to sort: 3 3
Enter the elements of the matrix for sorting: 2 7 5 9 3 8 1 4 0
Original matrix entered by the user:
2 7 5
9 3 8
1 4 0

Matrix after sorting its elements:
0 1 2
3 4 5
7 8 9
Thanks & Regards
Ms. Dipti
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 947
Reputation: MosaicFuneral is just really nice MosaicFuneral is just really nice MosaicFuneral is just really nice MosaicFuneral is just really nice MosaicFuneral is just really nice 
Solved Threads: 92
MosaicFuneral's Avatar
MosaicFuneral MosaicFuneral is offline Offline
Posting Shark

Re: Two dimensional array sorting

 
0
  #4
Nov 20th, 2008
Look up "Bubble sort", slow, but should work for what you described.
"Jedenfalls bin ich überzeugt, daß der Alte nicht würfelt."
"I became very sensitive to what will happen to all this and all of us." -Two geniuses named Albert
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 2,001
Reputation: ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of 
Solved Threads: 343
ArkM's Avatar
ArkM ArkM is offline Offline
Postaholic

Re: Two dimensional array sorting

 
0
  #5
Nov 20th, 2008
cutedipti, order (or ordering) relation is not the same thing as order of matrix in mathematics Only square matrix has an order, arbitrary matrix have dimensions.
Now you define (by example) desired ordering relation.
If the user enters matrix dimensions, what's your method to create MxN matrix?
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 320
Reputation: cikara21 is an unknown quantity at this point 
Solved Threads: 63
cikara21's Avatar
cikara21 cikara21 is offline Offline
Posting Whiz

Re: Two dimensional array sorting

 
0
  #6
Nov 24th, 2008
You guyz talk to much..She just want the codes..So!!...
.:-cikara21-:.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 2,001
Reputation: ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of 
Solved Threads: 343
ArkM's Avatar
ArkM ArkM is offline Offline
Postaholic

Re: Two dimensional array sorting

 
1
  #7
Nov 24th, 2008
Originally Posted by cikara21 View Post
You guyz talk to much..She just want the codes..So!!...
Probably but I'm here to give fishing-rods, not a fried fish
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC