• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

sorting a 2 multi-dimensional array

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
is it possible to sort a multi-dimensional array on basis of one of the attributes....hmm let me xplain a bit
say i have an array [a][b][c].
is it possible to sort on the basis of b alone.
I couldn't find a method/logic to do so.

ne pointers!!
TIA
dobi

"u don't get to be mom until u can fix everything just right" --calvin
 
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
a) Java does not have 2-dimensional arrays.
b) The concept of sorting an array of arrays of arrays is not well defined - you'll have to provide more context
 
Ranch Hand
Posts: 862
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you are talking about sorting a 2 dimensional array of objects then you can use the ArraySQL class that can be found at http://www.fdsapi.com. You can use a SQL like syntax to sort arrays with it.
 
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by dobriyal dobriyal:
is it possible to sort a multi-dimensional array on basis of one of the attributes....hmm let me xplain a bit
say i have an array [a][b][c].
is it possible to sort on the basis of b alone.
I couldn't find a method/logic to do so.

ne pointers!!
TIA
dobi

"u don't get to be mom until u can fix everything just right" --calvin




It's possible to do that.

Why you want to do in this solution ?
 
I was born with webbed fish toes. This tiny ad is my only friend:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic