Results 1 to 6 of 6
  1. #1
    Debonairj is offline Member
    Join Date
    Jul 2010
    Posts
    19
    Rep Power
    0

    Unhappy HELP: Sorted, Unsorted, & Indexed list

    So I have two list (List1 & list2). Each has 4 add statements and one remove statements. Then 4 println statements (SOrted, list1, unsorted, list2).

    UnsortedListInterface list1 = new RefUnsortedList();
    SortedListInterface list2 = new RefSortedList();

    Example:
    list1.add("apple")
    list1.add("pear")
    list1.add("peach")
    list1.add("orange")
    list1.remove("peach")
    and same thing for list2

    But I'm not sure about the result...For unsorted, would it be thefoloowing and vice versa in a sense for list2 sorted.
    apple
    orange
    pear

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,305
    Rep Power
    25

    Default

    Sorry, I missed your question or problem.
    Do you have a problem or question?
    if so, please post it.

  3. #3
    Debonairj is offline Member
    Join Date
    Jul 2010
    Posts
    19
    Rep Power
    0

    Default

    Well my question What is expected when I see the "Ref" appended to the newlist expected?

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,305
    Rep Power
    25

    Default

    What is expected when I see the "Ref" appended to the newlist expected
    Not sure what you are asking.
    Do you have a problem with the code you posted? Do you get compiler errors?
    Please copy and paste them here.

  5. #5
    Debonairj is offline Member
    Join Date
    Jul 2010
    Posts
    19
    Rep Power
    0

    Default

    Norm, sorry for the confusion. This is two separate issues/questions I have posted....

    On this particular thread, I'm trying to determine what is the expected result? Though it appears straight forward, the "REF" in front and attach to sorted or unsorted has thrown me through for a loop on the expected result..

    Example: "Ref" - I'm not change what this does ot the expected result?
    UnsortedListInterface list1 = new RefUnsortedlist();
    list.add("apple");
    list.add("pear");
    list.add("peach");
    list.add("orange");
    list.remove("peach");

  6. #6
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,305
    Rep Power
    25

    Default

    determine what is the expected result
    Why not write a program and find out the actual result?

    What you posted looks something like java code but it's hard to tell.
    Where are the classes: UnsortedListInterface and RefUnsortedlist defined?

Similar Threads

  1. Searching in Indexed XML
    By peliukasss in forum Lucene
    Replies: 0
    Last Post: 06-17-2010, 05:13 PM
  2. Casting an int from a sorted set
    By Bmack in forum New To Java
    Replies: 2
    Last Post: 03-17-2010, 07:09 PM
  3. Replies: 6
    Last Post: 04-13-2009, 04:19 AM
  4. How to create a Sorted List in Java
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-16-2008, 10:31 PM
  5. My doublyLinked list does not get sorted
    By hasani6leap in forum New To Java
    Replies: 0
    Last Post: 01-06-2008, 03:09 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
  •