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.

Last update: 2011.

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

 Insertion Sort Algorithm and Implementation

 Selection Sort Algorithm and Implementation

 Bubble Sort Algorithm and Implementation

 Quicksort Algorithm and Implementation

 Merge Sort Algorithm and Implementation

 Heap Sort Algorithm and Implementation

 Shell Sort Algorithm and Implementation

 Performance Summary of Java Implementations

 References

 PDF Printing Version