-6

I have an arraylist of movies that holds the movie title and director. I need to create a comparator that will first sort the directors in alphabetical order, and will sor the movies made by each director in alphabetical order. I also want to sort this data in ascending OR descending order.

e.g.

  1. James Cameron:

  2. Steven Spielberg

batsta13
  • 549
  • 2
  • 12
  • 26
  • 4
    So do it, what's the problem? – Maroun Jun 02 '13 at 07:14
  • Can you show the struggle with your code? – Juned Ahsan Jun 02 '13 at 07:14
  • 1
    http://mattgemmell.com/2008/12/08/what-have-you-tried/ – Tejas Patil Jun 02 '13 at 07:16
  • 1
    @batsta13: you're supposed to do your part of the job. If you're just looking for a free solution without even trying anything, then hire and pay a competent programmer. Otherwise, show what you have tried, and click on the links that have been given to you and show how to solve your problem (because you also failed to find the many questions that ask for the exact same thing). – JB Nizet Jun 02 '13 at 07:32
  • fuk u. Quit ur bitching – batsta13 Jun 05 '13 at 02:27

1 Answers1

0

after you've sorted the director list.... just take one director as an key value in outer loop and then start comparing each and every movie name in inner loop...

How can I sort a List alphabetically?

this would be helpful... do some searching next time....it is easy to find such solutions... :) ;)

Community
  • 1
  • 1
spt025
  • 2,134
  • 2
  • 20
  • 26