473,323 Members | 1,589 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

Implementing Linked List

1
implement the following four methods:



public void union(LinkedList 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(LinkedList ll);

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



public boolean subset(LinkedList 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.
Feb 27 '07 #1
2 1874
DeMan
1,806 1GB
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.
Feb 27 '07 #2
r035198x
13,262 8TB
implement the following four methods:



public void union(LinkedList 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(LinkedList ll);

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



public boolean subset(LinkedList 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.
Feb 28 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: adeleinandjeremy | last post by:
I am taking a second programming course in Java and am currently attempting to apply what I have learned using Python instead. One thing that is puzzling me is how to use an iterator. I am...
3
by: Adelein and Jeremy | last post by:
I am taking a second programming course in Java and am currently attempting to apply what I have learned using Python instead. One thing that is puzzling me is how to use an iterator. I am...
4
by: Chris Schadl | last post by:
Hi, I've written a simple sorted linked list class that I'm trying to implement an iterator for. I'm trying to make the interface to the iterator simmilar to the STL's iterator interface, so...
5
by: Dream Catcher | last post by:
1. I don't know once the node is located, how to return that node. Should I return pointer to that node or should I return the struct of that node. 2. Also how to do the fn call in main for that...
15
by: Bernard | last post by:
Hi All, I am not sure if I should be asking this question on clc or clc++. Let me try on both. I hope that this is not too trivial for the brilliant minds over here. I know that OOP questions...
6
by: Steve Lambert | last post by:
Hi, I've knocked up a number of small routines to create and manipulate a linked list of any structure. If anyone could take a look at this code and give me their opinion and details of any...
1
by: rllioacvuher | last post by:
I need help with a program. I have implemented that following header file with an unordered list using one array, but i need to be able to use an ordered list and 2 arrays (one for the links and one...
9
by: raylopez99 | last post by:
What's the best way of implementing a multi-node tree in C++? What I'm trying to do is traverse a tree of possible chess moves given an intial position (at the root of the tree). Since every...
0
by: Atos | last post by:
SINGLE-LINKED LIST Let's start with the simplest kind of linked list : the single-linked list which only has one link per node. That node except from the data it contains, which might be...
7
by: QiongZ | last post by:
Hi, I just recently started studying C++ and basically copied an example in the textbook into VS2008, but it doesn't compile. I tried to modify the code by eliminating all the templates then it...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.