2 dimention bubble sort

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • srikanthsharanya
    New Member
    • May 2010
    • 2

    2 dimention bubble sort

    i'm facing one problem with bubble sorting ....
    here we are using two dimension array, with 2 column and multiple rows.first column contains name and second column contains age. age should be sorted with name. but name need not be sorted
  • jkmyoung
    Recognized Expert Top Contributor
    • Mar 2006
    • 2057

    #2
    Possible solutions.
    1. Create a container class to store both elements and sort that.
    2. Whenever you swap ages, also swap the corresponding names.

    Comment

    Working...