All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class bradel.wordchanger.StaticSortSearch

java.lang.Object
   |
   +----bradel.wordchanger.StaticSortSearch

public class StaticSortSearch
extends Object
Has a sort routine and a binary search routine to sort and search arrays of String objects and ComparisonObjects Creation date: (30/12/2001 4:15:37 PM)

Author:
: Borys Bradel Copyright (c) 2001 Borys Bradel All rights reserved

Constructor Index

 o StaticSortSearch()
ShellSort constructor does nothing

Method Index

 o binarySearch(ComparisonObject[], ComparisonObject)
perform a binary search Creation date: (30/12/2001 5:11:37 PM)
 o binarySearch(String[], String)
perform a binary search Creation date: (30/12/2001 5:11:37 PM)
 o binarySearch(Vector, ComparisonObject)
perform a binary search if the element is not found the method returns -(1+low) low will always be at least 0, so this is okay low will also point to the element where to insert the new element for example, in the list (b,c,d) checking for aa yields low=0 high=-1 checking for bb yields low=1 high=0 checking for cc yields low=2 high=1 checking for dd yields low=3 high=2 therefore low shows where to insert (even when the list is empty) Creation date: (30/12/2001 5:11:37 PM)
 o deltaInsertionSort(ComparisonObject[], int, int)
This is an insertion sort routine used in shell sort that shifts all the elements in a certain set that are bigger than the first element so that the first element can then be inserted on one side The set of elements is determined by the delta value, since each element is delta elements from its neighbour.
 o deltaInsertionSort(String[], int, int)
This is an insertion sort routine used in shell sort that shifts all the elements in a certain set that are bigger than the first element so that the first element can then be inserted on one side The set of elements is determined by the delta value, since each element is delta elements from its neighbour.
 o shellSort(ComparisonObject[])
Perform a shell sort A shell sort starts off with a delta of some sort and then performs an insertion sort on elements that are delta entries apart Creation date: (30/12/2001 4:19:01 PM)
 o shellSort(String[])
Perform a shell sort A shell sort starts off with a delta of some sort and then performs an insertion sort on elements that are delta entries apart Creation date: (30/12/2001 4:19:01 PM)

Constructors

 o StaticSortSearch
 public StaticSortSearch()
ShellSort constructor does nothing

Methods

 o binarySearch
 public static int binarySearch(ComparisonObject sortedObjectArray[],
                                ComparisonObject checkString)
perform a binary search Creation date: (30/12/2001 5:11:37 PM)

Parameters:
sortedObjectArray - ComparisonObject[]
checkString - ComparisonObject
Returns:
int
 o binarySearch
 public static int binarySearch(String sortedStringArray[],
                                String checkString)
perform a binary search Creation date: (30/12/2001 5:11:37 PM)

Parameters:
sortedStringArray - java.lang.String[]
checkString - String
Returns:
int
 o binarySearch
 public static int binarySearch(Vector sortedObjectVector,
                                ComparisonObject checkString)
perform a binary search if the element is not found the method returns -(1+low) low will always be at least 0, so this is okay low will also point to the element where to insert the new element for example, in the list (b,c,d) checking for aa yields low=0 high=-1 checking for bb yields low=1 high=0 checking for cc yields low=2 high=1 checking for dd yields low=3 high=2 therefore low shows where to insert (even when the list is empty) Creation date: (30/12/2001 5:11:37 PM)

Parameters:
sortedObjectVector - Vector
checkString - ComparisonObject
Returns:
int
 o deltaInsertionSort
 private static void deltaInsertionSort(ComparisonObject objectArray[],
                                        int iPosition,
                                        int delta)
This is an insertion sort routine used in shell sort that shifts all the elements in a certain set that are bigger than the first element so that the first element can then be inserted on one side The set of elements is determined by the delta value, since each element is delta elements from its neighbour. Creation date: (30/12/2001 4:22:52 PM)

Parameters:
objectArray[] - ComparisonObject
iPosition - int
delta - int
 o deltaInsertionSort
 private static void deltaInsertionSort(String stringArray[],
                                        int iPosition,
                                        int delta)
This is an insertion sort routine used in shell sort that shifts all the elements in a certain set that are bigger than the first element so that the first element can then be inserted on one side The set of elements is determined by the delta value, since each element is delta elements from its neighbour. Creation date: (30/12/2001 4:22:52 PM)

Parameters:
stringArray[] - java.lang.String
iPosition - int
delta - int
 o shellSort
 public static void shellSort(ComparisonObject objectArray[])
Perform a shell sort A shell sort starts off with a delta of some sort and then performs an insertion sort on elements that are delta entries apart Creation date: (30/12/2001 4:19:01 PM)

Parameters:
objectArray - ComparisonObject[]
 o shellSort
 public static void shellSort(String stringArray[])
Perform a shell sort A shell sort starts off with a delta of some sort and then performs an insertion sort on elements that are delta entries apart Creation date: (30/12/2001 4:19:01 PM)

Parameters:
stringArray - java.lang.String[]

All Packages  Class Hierarchy  This Package  Previous  Next  Index