Implementing quick sort on a array of strings.
I need to sort an array of "textbook" objects using quick sort and then find a given book using binary search. But I am having trouble grasping how to sort strings in alphabetical order. I am aware of the comparable interface in java and its functionality but is their a way that I can use the interface to compare strings?
Thanks for the advice!
Kyle
Re: Implementing quick sort on a array of strings.
The String class has a method for comparing Strings.
Re: Implementing quick sort on a array of strings.
I am looking at the java API and rooking at Code:
public interface Comparable <T>
, which take in objects "T". So I'm assuming that "T" can just be string objects. Is this the method you speak of?
Re: Implementing quick sort on a array of strings.
You need to look at the methods in the String API