• Post Reply Bookmark Topic Watch Topic
  • New Topic

Sorting 2D Java Array  RSS feed

 
Noah Stahl
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So for this project in school I need to sort a 2D array to look like this, http://imgur.com/ZX7EQWP.
Here is the code that I have.
File 1:



File 2:
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

Do you have a question about the problem or the code?
 
Noah Stahl
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well it was about the code, but I did end up figuring it out. Thanks!
 
Campbell Ritchie
Marshal
Posts: 56570
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome again. I presume you figured out how bad arrays are for that sort of thing, and how you ought to have created a Rainfall class. That can implement the Comparable interface.
 
Aaron Morison
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could someone figure out how to get the last bit to output his image?


 
Campbell Ritchie
Marshal
Posts: 56570
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

I added code tags to yoru code. Doesn't it look better.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!