Thanks for the prompt reply Adak. I've looked at some of the quicksort
examples and I know they use recursion and divide & conquer for
implementation but I'm having difficulty extracting the pieces relevent
to me. Here is what I have so far, it currently generates a stack
overflow error so it's not terminating correctly...any suggestions
greatly appreciated.
void recurse(int a[], int from, int to)
{
while(!change)
{
if (a.length == 1)
{
System.out.println("Single Element!");
//call external function, then break loop condition
change = true;
}
// Handle left half
recurse(a, 0,(a.length / 2) - 1);
// Handle right half
recurse(a, a.length / 2, a.length);
}
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---