I have to create a Ordered Binary Tree for an assignment, and I'm stuck :/
I need to supply a default constructor for my CNode nested class or else when I allocate memory for the Nodes pointer I get an error. But once the default constructor values have been set for all of the elements I can't "overwrite" them to give the actual values I want. How can I do this?
Hi ascii. Is this chapter 9 exercise 4 from Hortons Beginning Visual C++ 2008 ?
Your binary tree is hard coded to have exactly 4 nodes. I think the idea is for the tree to hold as many data items as you have to store.
Notice the hint at the end of the exercise: Don't be afraid to use recursion!
Recursive methods seem to be very well suited to a binary tree.
Care to see what I got for this exercise?
fun2code, it is. It's been a good book so far but I don't want to have to buy a full version of Visual Studio just to use the MFC for one book (I'm never using it again xD) :-) I suppose I misinterpreted the question. For the first 7 or so chapters I kept overdoing all of the excersises, and I suppose I underdid this one. I already downloaded the answer and compared it to mine only to realize how wrong I was. Anyhow I'm on chapter 10 now, and having already seen the answer I don't really see the point in redoing it. Thank you anyhow :-)
I agree about the book. Great through ch. 10 but then I'm outta there. I'd like to know more about windows programming but his exclusive use of the MFC is a turn off. I'll learn it elsewhere.
I'm going to get the C++ Primer next. Looks like that will keep me busy for a while!