Unformatted text preview: adding each vote (or title) to a list. At the end, your first job is to detect whether there is one book that got the majority of the votes (i.e., it appears more than n/2 times in the list). Give a divideandconquer algorithm for finding such book if one exists, and provide its time complexity. Your algorithm should be faster than the O(n 2 ) bruteforce solution of counting the number of titles (by going through list) for each of the elements of the list. Also, you algorithm should not use a significant amount of extra memory (i.e., you can’t just create an array of counters, with one entry per title, and then iterate through the list, updating the counters appropriately). Finally, you should use only equality testing of the titles (i.e., you are not allowed to sort the array)....
View
Full Document
 Two '09
 George
 Algorithms, Sort, web site, 25%, Divide and conquer algorithm, divideandconquer algorithm

Click to edit the document details