public class Controller
extends java.lang.Object
Constructor and Description |
---|
Controller()
Base constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
ArrayBinaryInsert(int lowIndex,
int highIndex)
Binary search and insert for putting current value into sorted values.
|
protected void |
ArrayBinaryInsertionSort()
Calls binary insertion sort on appropriate linked list.
|
protected void |
ArrayBubbleSort()
Calls bubble sort on appropriate array.
|
protected void |
ArrayInsertionSort()
Calls insertion sort on appropriate linked list.
|
protected void |
ArrayMergeSort(int lowIndex,
int highIndex)
Calls merge sort on appropriate linked list.
|
protected void |
ArraySelectionSort()
Calls selection sort on appropriate linked list.
|
protected int |
CompareChars(char charA,
char charB)
Checks to see if charA is less than charB.
|
protected java.lang.String |
GetUserInput()
Acquire user input.
|
protected java.lang.String |
GetUserInput(java.lang.String promptString)
Prompt for and acquire user input.
|
protected void |
ListBinaryInsert(LinkedNode lowNode,
LinkedNode highNode,
int lowIndex,
int highIndex)
Binary search and insert for putting current value into sorted values.
|
protected void |
ListBinaryInsertionSort()
Calls binary insertion sort on appropriate linked list.
|
protected void |
ListBubbleSort()
Calls bubble sort on appropriate linked list.
|
protected void |
ListInsertionSort()
Calls insertion sort on appropriate linked list.
|
protected LinkedQueue |
ListMergeSort(LinkedQueue unsortedQueue,
int lowIndex,
int highIndex)
Calls merge sort on appropriate linked list.
|
protected void |
ListSelectionSort()
Calls selection sort on appropriate linked list.
|
protected void |
MergeArray(int lowIndex,
int midIndex,
int highIndex)
Handles actually merging array parts back together.
|
protected LinkedQueue |
MergeList(LinkedQueue firstHalf,
LinkedQueue secondHalf)
Handles actually merging list parts back together.
|
protected void |
PopulateData()
Populate arrays and linked lists, based on user input.
|
protected void |
PopulateDictionary()
Populates sorting dictionary based on user's provided name.
|
protected void |
PrintAllDataStructures()
Prints out values of all available data structures.
|
protected void |
PrintAllDictionaryValues()
Prints all key-value pairs within dictionary.
|
protected void |
PrintTimeValues()
Prints out time value data for all sorts.
|
protected void |
SortAllDataStructures()
Calls sorting on all available data structures.
|
protected void PopulateData()
protected void PopulateDictionary()
protected int CompareChars(char charA, char charB)
charA
- Expected smaller character.charB
- Expected larger character.protected void SortAllDataStructures()
protected void ArrayBubbleSort()
protected void ListBubbleSort()
protected void ArraySelectionSort()
protected void ListSelectionSort()
protected void ArrayMergeSort(int lowIndex, int highIndex)
lowIndex
- Lower bound index.highIndex
- Upper bound index.protected void MergeArray(int lowIndex, int midIndex, int highIndex)
lowIndex
- Starting index of first half.midIndex
- Ending index of first half/starting index of second half.highIndex
- Ending index of second half.protected LinkedQueue ListMergeSort(LinkedQueue unsortedQueue, int lowIndex, int highIndex)
unsortedQueue
- Queue to sort.lowIndex
- Lowest index for given queue section.highIndex
- Highest index for given queue section.protected LinkedQueue MergeList(LinkedQueue firstHalf, LinkedQueue secondHalf)
firstHalf
- First queue section to merge.secondHalf
- Second queue section to merge.protected void ArrayInsertionSort()
protected void ListInsertionSort()
protected void ArrayBinaryInsertionSort()
protected void ArrayBinaryInsert(int lowIndex, int highIndex)
lowIndex
- The lower bound for array section.highIndex
- The higher bound for array section.protected void ListBinaryInsertionSort()
protected void ListBinaryInsert(LinkedNode lowNode, LinkedNode highNode, int lowIndex, int highIndex)
lowNode
- The lower bound for list section.highNode
- The upper bound for list section.lowIndex
- The node number of the lower bound.highIndex
- The node number of the upper bound.protected java.lang.String GetUserInput()
protected java.lang.String GetUserInput(java.lang.String promptString)
promptString
- String to show user.protected void PrintAllDictionaryValues()
protected void PrintAllDataStructures()
protected void PrintTimeValues()