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.

What is a polymorphic algorithm?

ALGORITHM polymorphic
0
Posted

What is a polymorphic algorithm?

0

Location: http://www.jguru.com/faq/view.jsp?EID=213780 Created: Sep 22, 2000 Modified: 2005-08-17 01:43:25.62 Author: Avi Kak (http://www.jguru.com/guru/viewbio.jsp?EID=26410) In general, an algorithm is called polymorphic if it can achieve the same functionality using different data structures. For example, if the same sorting or searching algorithm could be used with different types of containers, such as vectors, lists, maps, etc., then that algorithm would be called polymorphic. As a case in point, the generic algorithms of the STL library in C++ are polymorphic because they can be used for different container classes. In the context of Java collections, the polymorphic algorithms are all supplied by the various static methods of the java.util.Collections class. Consider, for example, the method sort(List list). This method is capable of sorting any collection that has implemented the List interface, and that includes containers of types ArrayList, LinkedList, Vector, etc.

Related Questions

What is your question?

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

Experts123