Why Java API Is Needed

This section describes why Java API is needed for sorting algorithms The Java API (Application Programming Interface) is needed to provide a single standard calling interface for all Java applications that want to use the sorting algorithm.

When a sorting algorithm is implemented as a function in a particular programming language, it must interface with the application program that needs this function. So before writing an implementation of a sorting algorithm, we need to define the Application Programming Interface (API), to answer the following questions:

JDK (Java Development Kit) provides a very good API for implementing sorting algorithms in Java. It can be summarized as:

I will borrow JDK's sorting API to write and test my own implementations of sorting algorithms.

Table of Contents

 About This Book

 Introduction of Sorting Algorithms

Java API for Sorting Algorithms

Why Java API Is Needed

 HyObject.java - Data Element Class

 SortTest.java - Testing Program

 java.util.Arrays.sort() - Performance

 Performance Summary of Java Implementations

 Insertion Sort Algorithm and Java Implementation

 Selection Sort Algorithm and Java Implementation

 Bubble Sort Algorithm and Java Implementation

 Quicksort Algorithm and Java Implementation

 Merge Sort Algorithm and Java Implementation

 Heap Sort Algorithm and Java Implementation

 Shell Sort Algorithm and Java Implementation

 Sorting Algorithms Implementations in PHP

 Sorting Algorithms Implementations in Perl

 Sorting Algorithms Implementations in Python

 Performance Summary of All Implementations

 References

 Full Version in PDF/EPUB