Binary Tree

Pages: 12
For this assignment, design an EmployeeInfo class that holds the following employee information:

Employee ID Number: an integer
Employee Name: a string

Implement a binary tree whose nodes hold an instance of the EmployeeInfo class. The nodes should be sorted on the Employee ID number.

Test the binary tree by inserting nodes with the following information.

Employee ID Number
Name
1021

John Williams

1057

Bill Witherspoon

2487

Jennifer Twain

3769

Sophia Lancaster

1017

Debbie Reece

1275

George McMullen

1899

Ashley Smith

4218

Josh Plemmons



Your program should allow the user to enter an ID number, then search the tree for the number. If the number is found, it should display the employee’s name. If the node is not found, it should display a message indicating so.

can someone give me some tips on what i should be doing next ? this is all i have and i'm stuck
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 #include <iostream>
#include <string>

using namespace std;

class EmployeeInfo
{
private:
	string employeeName;
	int employeeID;

public:
	//constructor
	EmployeeInfo();
	//destrcutor
	EmployeeInfo(int, string);






};
https://www.cplusplus.com/forum/beginner/267203/
https://www.cplusplus.com/forum/beginner/267989/
https://www.cplusplus.com/forum/beginner/267977/
https://www.cplusplus.com/forum/beginner/268063/
https://www.cplusplus.com/forum/beginner/267215/
https://www.cplusplus.com/forum/beginner/268276/
I think we all know what the dance moves are by now.

You make a half-arsed initial post.
We pretend we're interested, by giving you some helping hand.
You then "find" some code, and try and palm it off as your own work.
We find that you've found the code, but carry on denying it anyway.
You keep tinkering with it in futility, making random changes.
Someone eventually caves and gives you your spoon-fed answer.
With luck, we'll all be done before it spans multiple pages.
Dude how can you say this little bit of code is "someone elses" code or that I am palming it off as my own ????? IT IS MY OWN ! All I did was create a class. Is creating a simple class taking someone elses code ????????????????????????????????? Get real.
Dude, you're a lying cheating piece of shit!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Get a brain.
vladmir putin troll has arrived
Hmm, I don't think Vlad has anything to do with you making 0 effort then copying random code from the internet.

1
2
	//destrcutor
	EmployeeInfo(int, string);
That's not a destrcutor, by the way.

Although, to be fair, a lot of jobs involve copying random code from SO these days, so maybe this counts as job experience.

_________________________________

Okay, because I can't help myself, I will say: The code you have shown has NOTHING to do with a binary tree. All it is is the shell of a simple wrapper of an int + a string.

Show us actual attempt at making a binary tree first.
Last edited on
vladmir putin troll has arrived

meaningless
*dragging a lounge chair, a cooler of adult beverage and a LOT of popcorn into position*

This is looking to be quite a show.

As Ganado so pointedly mentioned, what little source code you posted has very little to do with what your assignment allegedly is. Labeling a constructor overload as a "destrcutor" is especially revealing of a lack of any real effort being done to learn.

If that offends, tough. Maybe programming is not your "thing." No shame in admitting that.
If I stole someone’s code why would I have the destructor wrong ? Goof ball
I’m a basic beginner. Not an expert.
So write some code yourself. Show you have a grasp on the requirements of the assignment other than to just vomit up the bare minimum, hoping someone takes pity and does the work for you. Some code to implement a binary tree might show that. Even if just in pseudocode or a bare code framework.

I an not an expert either, but I write code and write code and write code to help me understand parts of the language I am not familiar with.

Something real simple, yet until I worked on writing the code it would have been baffling and difficult; dealing with two std::unique_ptr arrays and swapping the contents.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include <iostream>
#include <memory>

int main()
{
   int size { 10 };

   std::unique_ptr<int[]> uparray1(new int[size]);

   for (int i { }; i < size; ++i)
   {
      uparray1[i] = (i == 0) ? 1 : i * uparray1[i - 1];
   }

   std::unique_ptr<int[]> uparray2(new int[size]);

   for (int i { }; i < size; ++i)
   {
      uparray2[i] = (i == 0) ? 1 : i * 2 * uparray2[i - 1];
   }

   for (int i { }; i < size; i++)
   {
      std::cout << i << ": " << uparray1[i] << '\n';
   }
   std::cout << '\n';

   for (int i { }; i < size; i++)
   {
      std::cout << i << ": " << uparray2[i] << '\n';
   }
   std::cout << '\n';

   std::cout << "Swapping unique_ptr arrays....\n\n";
   uparray1.swap(uparray2);

   for (int i { }; i < size; i++)
   {
      std::cout << i << ": " << uparray1[i] << '\n';
   }
   std::cout << '\n';

   for (int i { }; i < size; i++)
   {
      std::cout << i << ": " << uparray2[i] << '\n';
   }
   std::cout << '\n';
}

To the experts here I'd bet they'd consider this code to be laughably noobish. And they'd be correct.

I’m a basic beginner. Not an expert.

You make a lot of excuses, yet show very little actual code.

The only way to learn to program is:

WRITE CODE.

Look at code snippet samples and language feature examples and then adapt the code to help shove the idea into your brain.

https://www.cprogramming.com/beginner_programming_mistakes.html
https://www.cprogramming.com/how_to_learn_to_program.html
I DID WRITE CODE ! What i wrote is the furthest I know. Anything further would be total guessing
cblack618 is a liar and a cheat.
Do not help him.

* this is an automated response
If you don't know what a binary tree is then I suggest you go study up on the concept. On your own.

https://duckduckgo.com/?q=c%2B%2B+code+binary+tree&t=ffsb&ia=web

Expecting others to do your homework won't help you learn. It certainly won't get you any closer to doing the assignment on time.
I am not expecting others to do my homework. If so, All i would of done was posted the assignment instrutions. However, I do neep helps and tips though
cblack618 is a liar and a cheat.
Do not help him..

* this is an automated response
Dutch find a better usage of your time.
cblack618 is a liar and a cheat.
Do not help him...

* this is an automated response
i see you are using a loop to harass and spam this post
cblack618 is a liar and a cheat.
Do not help him....

* this is an automated response
Pages: 12