Hey all,
I've written a code for finding the index of an int array using a binary search, but I cant find out to do the same with a String Array. Basically the user enters an artist (ignoring case), which use a search method (binary, linear but not bubble sort) to output the index of the artist in the charts (obviously using a +1). Could you please advise me on the appropriate search method for String Arrays.
I've only got the start so far.....
Cheers
Brian
import java.util.*; public class ChartPosition { public static void main(String args[]) { Scanner myKeyboard = new Scanner(System.in); String[] Artist = {"Alexis Jordan", "Bruno Mars", "Cee Lo Green", "Cheryl Cole", "Duck Sauce", "Katy Perry", "Mike Posner", "Nelly", "Rihanna", "The Saturdays"}; } }