Sorting an Array (Ascending Order)

Need help with sorting an array into ascending order

Page 1 of 1

1 Replies - 2733 Views - Last Post: 21 May 2009 - 09:44 AM Rate Topic: -----

#1 zanyrogue  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 91
  • Joined: 16-January 09

Sorting an Array (Ascending Order)

Post icon  Posted 21 May 2009 - 08:33 AM

Hi, I need help in being able to sort this array. I'd like to sort it in ascending order.

class Ascending2
{
	public static void main (String [] args)
	{

	int n[];
	n = new int[5];

	n[0]=9;
	n[1]=5;
	n[2]=11;
	n[3]=5;
	n[4]=8;


	for (int i=0; i<5; i++)
		System.out.println(n[i]);

	}
}


Is This A Good Question/Topic? 0
  • +

Replies To: Sorting an Array (Ascending Order)

#2 ralph_komer  Icon User is offline

  • D.I.C Head

Reputation: 13
  • View blog
  • Posts: 71
  • Joined: 12-May 09

Re: Sorting an Array (Ascending Order)

Posted 21 May 2009 - 09:44 AM

You need to apply a sorting algorithm to this array like selection, insertion, bubble or quick sort. If you have any issues in implementation then only we can help you.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1