Kizspy | Question: 40 (Choose 1 answer)
You are developing an e-commerce platform, and you need to display a list of products sorted by their prices in ascending order. Explain how you would use Java collections to achieve efficient sorting, and choose the most suitable sorting algorithm for this scenario.
A. Use Collections.sort() with a custom comparator.
B. Implement a custom quicksort algorithm for precise control.
C. Choose Arrays.sort() for simplicity and performance.
D. Utilize a Priority Queue for automatic sorting during insertion.
E. Implement a custom bubble sort algorithm for educational purposes.
F. Use Comparator.reverseOrder() for descending order sorting.