How will you sort the elements of array in descending order?



How will you sort the elements of array in descending order?..

Answer / Manoj Agarwal

To sort an array in descending order, you can use the Arrays.sort() method in Java with a custom Comparator that reverses the natural ordering of elements.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Data Structures Interview Questions

Which sorting algorithm is the slowest?

1 Answers  


What is raid (redundant array of inexpensive disks)?

1 Answers  


How is the front of the queue calculated ?

1 Answers  


Define general trees?

1 Answers  


How many sorting algorithms are there?

1 Answers  


What are the tasks performed during preorder traversal?

1 Answers  


What is the heap in data structures?

1 Answers  


Explain the common uses of tree database.

1 Answers  


What are the properties of binary heap?

1 Answers  


Why quicksort is better than merge sort?

1 Answers  


Is data structure a data type?

1 Answers  


What is the function of stack?

1 Answers  


Categories