Wrox Programmer Forums
|
BOOK: Ivor Horton's Beginning Visual C++ 2008 ISBN: 978-0-470-22590-5
This is the forum to discuss the Wrox book Ivor Horton's Beginning Visual C++ 2008 by Ivor Horton; ISBN: 9780470225905
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Ivor Horton's Beginning Visual C++ 2008 ISBN: 978-0-470-22590-5 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 2nd, 2010, 12:04 PM
Authorized User
 
Join Date: Feb 2010
Posts: 11
Thanks: 1
Thanked 0 Times in 0 Posts
Default poll/discussion on BinaryTree exercise problems of Chapter 9

Did you attempt the three BinaryTree exercise problems at the end of chapter 9? Please reply, indicating yes or no, why, and how it went for you if yes.
 
Old April 2nd, 2010, 12:08 PM
Authorized User
 
Join Date: Feb 2010
Posts: 11
Thanks: 1
Thanked 0 Times in 0 Posts
Default response

I attempted all three. My approach was to try all three before looking at the on-line solutions. I decided to not use recursion, and use a brute force, straightforward approach to building the tree. I ended up using a value class as the inner class, after first trying to make the inner class be a ref class. I successfully built the tree using native and clr code, in problems 4 and 5. I decided to make my printout of the nodes be a dump of node pointers/numbers and their stored values, rather than try to print out in ascending values. This approach let me see that the tree was built properly.

I attempted to do the generic BinaryTree exercise, problem 6. Note this book is my first exposure to CLR. I feel that the book did not prepare me well enough for problem 6. One reason is the following. The on-line solution uses:
Code:
generic<typename T > where T:IComparable ref class BinaryTree
.
I have not found the “where T:IComparable” syntax in chapter 9. If
Code:
generic<typename T > ref class BinaryTree :IComparable
is used instead, the code will not compile. (Please explain, if you know why this is so.)

I would like to add that overall, I am very satisfied with the book and exercises through chapter 9, which is as far as I have gotten so far.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 8 exercise 1 Will BOOK: Beginning C# 3.0 : An Introduction to Object Oriented Programming ISBN: 978-0-470-26129-3 2 March 2nd, 2010 03:26 PM
Chapter 4 Exercise 4 Will BOOK: Beginning Microsoft Visual C# 2008 ISBN: 978-0-470-19135-4 2 September 18th, 2009 11:08 AM
chapter 9 exercise michaelcode BOOK: Beginning ASP.NET 1.0 1 April 9th, 2006 03:56 PM
Chapter 6 - problems with exercise jedster BOOK: Beginning Access VBA 0 May 21st, 2004 07:12 AM
Chapter 5, Exercise 2, Class Problems nmstudent BOOK: Beginning Java 2 1 December 12th, 2003 07:08 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.