Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

In a TreeMap, can I use a sorting algorithm other than the natural sorting for the keys?

0
Posted

In a TreeMap, can I use a sorting algorithm other than the natural sorting for the keys?

0

Location: http://www.jguru.com/faq/view.jsp?EID=396730 Created: Apr 5, 2001 Author: John Zukowski (http://www.jguru.com/guru/viewbio.jsp?EID=7) Question originally posed by Shailesh Mangal (http://www.jguru.com/guru/viewbio.jsp?EID=57184 You can pass a Comparator to the TreeMap constructor to use a sorting order other than the natural order.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123