Results 1 to 3 of 3
  1. #1
    starterkit123 is offline Member
    Join Date
    May 2013
    Posts
    1
    Rep Power
    0

    Default Help with linkedlist sort() and reverse

    Modify the LinkedList1 presented in this chapter by adding
    sort() and reverse() methods.
    The reverse method reverses the order of the elements in the
    list,
    and the sort method rearranges the elements in the list so
    they
    are
    sorted in alphabetical order. Do not use recursion to
    implement
    either of these operations. Extend the graphical interface
    in
    the
    LinkedList1Demo class to support sort and reverse commands,
    and
    use
    it to test the new methods.


    (linkedlist1 source code:)

    /** The LinkedList1 class implements a Linked list. */ class LinkedList1 - Pastebin.com

    (linked1 demo source code)
    import java.awt.*; import java.awt.event.*; import javax.swing.*; import java - Pastebin.com

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

    Default Re: Help with linkedlist sort() and reverse

    A lot of folk can't or won't follow links. The reasons vary from corporate firewalls to the laziness that programmer's prize for its productivity. But one reason stands out: this is a "help" site and nobody can really help without knowing where you're coming from. So you might do better to make the problem specific (pick one, eg the reverse one might be easier), have a go, and post your code.

    It really doesn't matter whether it wroks or not. But explain how you are going about the implementation, and what compiler messages or runtime exceptions etc you encounter.

  3. #3
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    12,009
    Rep Power
    20

    Default Re: Help with linkedlist sort() and reverse

    Moving to New To Java.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. What does LinkedList.Node head = linkedList.head(); does?
    By Jack_Tauson_Sr in forum New To Java
    Replies: 1
    Last Post: 04-19-2013, 08:32 AM
  2. Replies: 10
    Last Post: 03-15-2012, 10:46 AM
  3. Replies: 11
    Last Post: 01-25-2012, 01:43 AM
  4. Using Merge Sort to sort an ArrayList of Strings
    By coldfire in forum New To Java
    Replies: 3
    Last Post: 03-13-2009, 01:03 AM
  5. How to sort a list using Bubble sort algorithm
    By Java Tip in forum Algorithms
    Replies: 3
    Last Post: 04-29-2008, 08:04 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •