sorting.InsertionSort Class Reference

The InsertionSort class extends the Sort class and sorts arrays with the insertionsort algorithm. More...

Inherits sorting.Sort.

Inheritance diagram for sorting.InsertionSort:

Inheritance graph
[legend]
Collaboration diagram for sorting.InsertionSort:

Collaboration graph
[legend]
List of all members.

Protected Member Functions

void doSort ()
 This is the sorting algorithm.

Private Member Functions

void move (int i, int j, int[] a)
int binsearch (int[] a, int low, int high, int x)
 A binary search algorithm.

Detailed Description

The InsertionSort class extends the Sort class and sorts arrays with the insertionsort algorithm.

The used insertionsort code is adapted from http://de.wikipedia.org/wiki/Insertionsort.

Definition at line 22 of file InsertionSort.java.


Member Function Documentation

int sorting.InsertionSort.binsearch int[]  a,
int  low,
int  high,
int  x
[private]
 

A binary search algorithm.

This is a binary search algorithm (http://en.wikipedia.org/wiki/Binary_search_algorithm) to locate the searched value in a array of integer.

Definition at line 59 of file InsertionSort.java.

Referenced by sorting.InsertionSort.doSort().

void sorting.InsertionSort.doSort  )  [protected]
 

This is the sorting algorithm.

The used insertionsort code is adapted from http://de.wikipedia.org/wiki/Insertionsort.

Reimplemented from sorting.Sort.

Definition at line 30 of file InsertionSort.java.

References sorting.InsertionSort.binsearch(), sorting.Sort.calcRuntime(), sorting.InsertionSort.move(), and sorting.Sort.theArray.

Here is the call graph for this function:

void sorting.InsertionSort.move int  i,
int  j,
int[]  a
[private]
 

Definition at line 43 of file InsertionSort.java.

Referenced by sorting.InsertionSort.doSort().


The documentation for this class was generated from the following file:
Generated on Thu Jun 22 19:07:32 2006 for Doxygen Example (Java) by  doxygen 1.4.5