473,397 Members | 1,960 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,397 software developers and data experts.

Design for the program.

I have a assignment for a program. Could any one tell me the class design, so that it will be the best program. The assignment is like this:

1. Create a program to simulate an in-memory Binary Tree with several nodes.

2. Each node should comprise of a unique key, which can be a character string; and a value of the node.

3. Left and right nodes must be chosen on comparing the keys of the parent/root node.

4. Program should continuously provide options for – addition, modification and deletion of a node.

5. Feature to display the whole tree at any time should be provided.

6. When deleting a node, there needs to be a proper logic to see where the child nodes should be attached. Care should be taken not to delete the root node.

7. C++ Program Required.


Thanks in advance.
Dec 21 '07 #1
3 1268
gpraghuram
1,275 Expert 1GB
I have a assignment for a program. Could any one tell me the class design, so that it will be the best program. The assignment is like this:

1. Create a program to simulate an in-memory Binary Tree with several nodes.

2. Each node should comprise of a unique key, which can be a character string; and a value of the node.

3. Left and right nodes must be chosen on comparing the keys of the parent/root node.

4. Program should continuously provide options for – addition, modification and deletion of a node.

5. Feature to display the whole tree at any time should be provided.

6. When deleting a node, there needs to be a proper logic to see where the child nodes should be attached. Care should be taken not to delete the root node.

7. C++ Program Required.


Thanks in advance.

Hi,
Instead of asking us to do some design for you.
start your design first and then post the design here.
Then people can comment on that.

Thanks
Raghuram
Dec 21 '07 #2
sicarie
4,677 Expert Mod 4TB
What classes can you see in there that you need? I will start with a "node" class. Any more that you can see?

And what methods will that node class need?
Dec 21 '07 #3
weaknessforcats
9,208 Expert Mod 8TB
There are plenty of books on this. Get a copy of Teach Yourself Data Structures and Algorithms in 24 Hours by Robert LaFore.
Dec 21 '07 #4

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

Similar topics

0
by: Mobile Boy 36 | last post by:
I'm trying to make a very simple Textbox with a FocusColor property...When the focus changes to the control, the backcolor must change automaticly to the color set by the focusColor property....
13
by: KV | last post by:
I'm new to OO Design, and I'm fixing to start writing my very first C# program. Given the complexity of OO programming, I would like to run something by this group and get general input. My...
11
by: John Fly | last post by:
I'm working on a large project(from scratch). The program is essentially a data file processor, the overall view is this: A data file is read in, validated and stored in a memory structure...
23
by: JoeC | last post by:
I am a self taught programmer and I have figured out most syntax but desigining my programs is a challenge. I realize that there are many ways to design a program but what are some good rules to...
10
by: sunny | last post by:
Does this following program implement the factory design.if not what are things that i have to change in order to make this following program to be designed to factory design pattern. ...
0
by: YellowFin Announcements | last post by:
Introduction Usability and relevance have been identified as the major factors preventing mass adoption of Business Intelligence applications. What we have today are traditional BI tools that...
6
by: JoeC | last post by:
I have a question about designing objects and programming. What is the best way to design objects? Create objects debug them and later if you need some new features just use inhereitance. Often...
9
by: Grizlyk | last post by:
Somebody have offered std colors to C++ in the msg here: http://groups.google.com/group/comp.lang.c++/browse_frm/thread/2e5bb3d36ece543b/1acf6cd7e3ebdbcd#1acf6cd7e3ebdbcd The main objection to...
12
Banfa
by: Banfa | last post by:
I was mildly concerned when I saw else where on the forum on of our experts express the opinion that software design saw not required and their prefered design method of development was to just start...
5
by: istillshine | last post by:
Particularly for medium-sized (10,000 ~ 20,000 lines) programs, what are useful strategies to design them before coding? My strategies are: 1. Imagine what the final program would look like....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.