anyone know c++ well

JOHNGALT99

Senior member
Mar 26, 2001
431
0
71
Tittle says it all.

I need some c++ help ASAP and willing to pay if someone is interested.

Must know data structures well
 

Crescent13

Diamond Member
Jan 12, 2005
4,793
1
0
I know C++, but I don't have a degree or anything...

If you tell me the problem I *might* be able to figure it out.
 

mugs

Lifer
Apr 29, 2003
48,920
46
91
Haha... sounds like help on homework... ;)

Probably doesn't pay well enough to interest me. :p


... how much does it pay? :)
 

JOHNGALT99

Senior member
Mar 26, 2001
431
0
71
I am having trouble writing a program that uses binary search trees,

It pretty basic stuff but this is my first c++ class

Rate is negotiable, but I would be looking for someone to work with me through out writing the program
 

purbeast0

No Lifer
Sep 13, 2001
53,764
6,645
126
what part about BST's are you having problems with? just the structure itself and how they actually work, like the concept? or do you know the concept and don't know how to put it in code?

or is it both?
 

Gunslinger08

Lifer
Nov 18, 2001
13,234
2
81
Just create a "node" object which has 2 pointers to child nodes. In your main program, have a headNode which is the root of the tree. To traverse it, set the currentNode to the head node. Check the value of the currentNode against the value you're searching for. If it's higher, set the rightChildNode as currentNode. If it's lower, set the leftChildNode as currentNode. Continue this until you find the item you're looking for, or reach a node with no child nodes.
 

cKGunslinger

Lifer
Nov 29, 1999
16,411
57
91
Originally posted by: JOHNGALT99
I am having trouble writing a program that uses binary search trees,

It pretty basic stuff but this is my first c++ class

Rate is negotiable, but I would be looking for someone to work with me through out writing the program

No offense, but if you can't hack BSTs in your first CS class on your own, I'd switch majors. Getting tutoring is fine, but you should be able to get help from your class mates or a professor.

This reeks of "I'll pay someone anonymous to do my homework for me."
 

JOHNGALT99

Senior member
Mar 26, 2001
431
0
71
ok , but what if I need to store mulitple items in a node, like first name last name of the person, plus there parents name ect. I am not sure how to do that.

I have a unquie number for each person to use as the key.
 

JOHNGALT99

Senior member
Mar 26, 2001
431
0
71
a information security and assurance degree

working on a third degree. doing ok in the class but this part as gotten me lost.

I under stand the concept and can write a simple binary search tree, but storing multiple items in a node has me lost
 

cKGunslinger

Lifer
Nov 29, 1999
16,411
57
91
Originally posted by: JOHNGALT99
ok , but what if I need to store mulitple items in a node, like first name last name of the person, plus there parents name ect. I am not sure how to do that.

I have a unquie number for each person to use as the key.
You have learned about classes/structures, no?

class Node
{
private:
int key;
string firstName;
string lastName;
string parentName;
public:
int getkey();
string getFirstName();
string getLastName();
string getParentName();
}


Put whatever you want in the data section, along with the key.
 

Gunslinger08

Lifer
Nov 18, 2001
13,234
2
81
Originally posted by: JOHNGALT99
ok , but what if I need to store mulitple items in a node, like first name last name of the person, plus there parents name ect. I am not sure how to do that.

I have a unquie number for each person to use as the key.

That's easy to do. The node object you create will have all of those as public attributes.

It's been a while since I've written code in C++, but it should look something like this:

class Node
{

public String firstName;
public String lastName;
public String parentName;
public Node *leftChildNode;
public Node *rightChildNode;

public int ID;

public Node(String firstName, String lastName, String parentName, int ID)
{
this.firstName == firstName;
this.lastName == lastName;
this.parentName == parentName;
this.ID == ID;
leftChildNode == null;
rightChildNode == null;
}

}
 

JOHNGALT99

Senior member
Mar 26, 2001
431
0
71
ok now it is making a little more sense.

I did write my node as a class, but didnt realize i could store multiple items in the node.

Thanks
 

DaShen

Lifer
Dec 1, 2000
10,710
1
0
How much are we talking here? if it is a school project, then do your own homework. if legit and good $$, I can pick up another contract in about 3 weeks.
 

purbeast0

No Lifer
Sep 13, 2001
53,764
6,645
126
yea dude all the info you need is already given to you in this thread. they told you how to create a node and how to traverse the the tree as well. and from the traversing algorithm, that also shows you where/how to place the new nodes entered in the BST.
 

JOHNGALT99

Senior member
Mar 26, 2001
431
0
71
thanks all for the help.

My brain just needed a swift kick.

might be back with more questions later.

FYI my background is in

International Relations BS
Minor in Physics
MA International Relations

Working my ass off to get a MS in information security and assurance now

I am in the washington dc area, if anyone else is out here as well feel free to say hello

thanks again
 

DaShen

Lifer
Dec 1, 2000
10,710
1
0
Originally posted by: JOHNGALT99
I am having trouble writing a program that uses binary search trees,

It pretty basic stuff but this is my first c++ class

Rate is negotiable, but I would be looking for someone to work with me through out writing the program

Do your own homework dude.:|
 

EagleKeeper

Discussion Club Moderator<br>Elite Member
Staff member
Oct 30, 2000
42,589
5
0
Originally posted by: DaShen
Originally posted by: JOHNGALT99
I am having trouble writing a program that uses binary search trees,

It pretty basic stuff but this is my first c++ class

Rate is negotiable, but I would be looking for someone to work with me through out writing the program

Do your own homework dude.:|

He admitted that he had a problem, explained the issue and an explanation was provided. He acknolwdged it with gratitude
ok now it is making a little more sense.

I did write my node as a class, but didnt realize i could store multiple items in the node.

Thanks
Looking a few posts up rather than jumping all over him based on the original post was uncallled for.