Home | Submit an interview question | Filter by category | Filter by job function | Filter by company
 
Member Information
User Id
Password
 
Forgot Password
Technology Category
.NET (1202)
Languages (103)
Database (146)
Operating System (48)
Reporting (5)
Third-Party Tools (2)
Testing (91)
OOP (75)
Web Development (40)
Design Patterns (89)
General (9)
Networking (88)
Hardware (63)
Brain Exercise (2)
Others (37)
 Our Network
.NET Heaven
C# Corner
Interview Corner
Longhorn Corner
Mindcracker
VB.NET Heaven
Home » .NET » .NET
How can you sort the elements of the array in descending order?
Posted by Pradeep Sep 17, 2009
Viewed : 717 times
Major Category : .NET
Minor Category : ASP.NET
Total Replies : 3
Become a Sponsor
 EDITORIAL ANSWER  
No Reply Yet
 ANSWERS BY USERS  
Tushar Mishra
Sep 22, 2009

Hello Pradeep

 The answers suggeted by other users should work fine. There are better means of sorting arrays, depending upon the type of data that they carry. Some of the techiniques are Bubble Sort, Liner Sort, Selection Sort each of these will solve your problem, all you have to do modify the logoc appropriately. 

 For Ex.

  A simple Linear Sort  will swap the location of the elements if  (arr[i]>arr[i+1]), then swap , just  change that to if(arr[i+1>arr[i]) , then swap

Sapna Malik
Sep 20, 2009
By calling Sort() method and then Reverse() method.
rupali
Sep 18, 2009

use sort and reverse methods of array

array.sort() - this sorts in asc order

array.reverse()

  
1

 

 Hosted by MaximumASP  |  Found a broken link?  |  Contact Us  |  Terms & conditions  |  Privacy Policy  |  Advertise with us
Current Version: 2.2009.3.2
 © 1999 - 2009  Mindcracker LLC. All Rights Reserved