Implementing Linked List

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • huvur1
    New Member
    • Feb 2007
    • 1

    #1

    Implementing Linked List

    implement the following four methods:



    public void union(LinkedLis t ll, boolean addFront);

    Return a new LinkedList whose members consist of elements that are members of this LinkedList, ll, or both. If addFront is true, unite the ll from the beginning of this LinkedList, otherwise from the end.



    public LinkedList difference(Link edList ll);

    Return a new LinkedList whose members consist of elements that are members in this LinkedList, but not in ll.



    public boolean subset(LinkedLi st ll);

    Return true if and only if ll is a subset of this LinkedList, return false otherwise.



    public BST toBST();

    Return a BST object from this LinkedList.
  • DeMan
    Top Contributor
    • Nov 2006
    • 1799

    #2
    Nice....Have you started?
    Think about how you would approach the problem....How would you implement a linked list, or are you allowed to use one prepared earlier fso long as you implement the Set functionality?

    Please try to be more specific with where you are having difficulty, the idea of these forums is not to provided answers to everybodies' assignments, but rather to help people to solve problems that they may be having and (hopefully) understand the problem better.

    Comment

    • r035198x
      MVP
      • Sep 2006
      • 13225

      #3
      Originally posted by huvur1
      implement the following four methods:



      public void union(LinkedLis t ll, boolean addFront);

      Return a new LinkedList whose members consist of elements that are members of this LinkedList, ll, or both. If addFront is true, unite the ll from the beginning of this LinkedList, otherwise from the end.



      public LinkedList difference(Link edList ll);

      Return a new LinkedList whose members consist of elements that are members in this LinkedList, but not in ll.



      public boolean subset(LinkedLi st ll);

      Return true if and only if ll is a subset of this LinkedList, return false otherwise.



      public BST toBST();

      Return a BST object from this LinkedList.
      Find time to read this.

      Comment

      Working...