Anybody have a good approach for alphabetizing 5000 names in a .txt file separated by commas?
I suppose I could make 5000 arrays, and then..
I already took all the quotations out of the txt document, and made a method to calculate a number which = value of each name (mark = 13 + 1 + 18 + 11) multiplied by it's place on the list (if 5000'th name, multiply 43 by 5000). That works elegantly with a list of names- though for this problem I'm looking to alphabetize them first. Any tips when using arrays? I have yet to learn arrays in depth yet
There are loads of sorting algorithms Have a look at http://en.wikipedia.org/wiki/Sorting_algorithm
Looked at Radix sort? You make an array, vector, etc, of them all, then up to 1 per letter a to z. Based on the first letter, you dump from the first array into sub arrays. Then you just need to sort the A array using the second letter... or whatever method you choose. Basically this is a way of breaking the large problem into several smaller ones.
Join our real-time social learning platform and learn together with your friends!