Search:

Type: Posts; User: mia_tech

Search: Search took 0.10 seconds.

  1. Replies
    7
    Views
    2,523

    Re: organizing linkedlist in ascending order

    you mean that I should have "Comparable" class inside "Student" class that implements a compareTo() method?
  2. Replies
    7
    Views
    2,523

    Re: organizing linkedlist in ascending order

    the only way I can use the "compareTo" method I implemented in the student class is if I use like this


    public void add(Student s)
    {
    Node newNode = new Node(s);
    ...
  3. Replies
    7
    Views
    2,523

    Re: organizing linkedlist in ascending order

    forgot to mentioned it... it is implemented in the Person class


    //method to compare student names
    public int compareTo(String fn, String ln)
    {
    return...
  4. Replies
    7
    Views
    2,523

    organizing linkedlist in ascending order

    guys, I have the following method (add), and as I'm adding values to the list I need to order in ascending order based on firstNmae+" "+lastName. I tried using the Collections.sort(students) in the...
Results 1 to 4 of 4