MESSAGE
DATE | 2015-02-26 |
FROM | Ruben
|
SUBJECT | Re: [LIU Comp Sci] Binary tree Excersize
|
From owner-learn-outgoing-at-mrbrklyn.com Thu Feb 26 13:38:26 2015 Return-Path: X-Original-To: archive-at-mrbrklyn.com Delivered-To: archive-at-mrbrklyn.com Received: by mrbrklyn.com (Postfix) id 66434161297; Thu, 26 Feb 2015 13:38:26 -0500 (EST) Delivered-To: learn-outgoing-at-mrbrklyn.com Received: by mrbrklyn.com (Postfix, from userid 28) id 5763E1612E0; Thu, 26 Feb 2015 13:38:26 -0500 (EST) Delivered-To: learn-at-mrbrklyn.com Received: from mailbackend.panix.com (mailbackend.panix.com [166.84.1.89]) by mrbrklyn.com (Postfix) with ESMTP id BD752161297 for ; Thu, 26 Feb 2015 13:38:25 -0500 (EST) Received: from [148.4.97.149] (unknown [148.4.97.149]) by mailbackend.panix.com (Postfix) with ESMTPSA id 63C8710D28 for ; Thu, 26 Feb 2015 13:38:25 -0500 (EST) Message-ID: <54EF686D.5030809-at-panix.com> Date: Thu, 26 Feb 2015 13:39:41 -0500 From: Ruben User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: learn-at-mrbrklyn.com Subject: Re: [LIU Comp Sci] Binary tree Excersize References: <54EB4BE9.6020505-at-panix.com> <54EBF7E1.2070605-at-panix.com> <54EBFCC9.8070605-at-my.liu.edu> <54EDCB27.5080904-at-my.liu.edu> <54EDCC82.2090800-at-panix.com> <3DDAC115-E003-494C-8FEA-9A31DB7B13A4-at-my.liu.edu> In-Reply-To: <3DDAC115-E003-494C-8FEA-9A31DB7B13A4-at-my.liu.edu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-learn-at-mrbrklyn.com Precedence: bulk Reply-To: learn-at-mrbrklyn.com
I'm here now
On 02/25/2015 12:13 PM, Keisha Sylvester wrote: > Ruben, > What time will you be in school today? > > Keisha G. Sylvester > > Sent from my iPad > > On Feb 25, 2015, at 8:22 AM, Ruben Safir > > wrote: > >> On 02/25/2015 08:16 AM, Ruben wrote: >>> On 02/24/2015 12:32 PM, Maneesh Kongara wrote: >>>> int node_count(const BinTree& node) >>>>> { >>>>> int static count = 0; >>>>> if(node == 0) >>>>> { >>>>> return count; >>>>> } >>>>> node_count(node->left); >>>>> node_count(node->right); >>>>> count++; >>>>> return count; >>>>> } >>> >>> this is the part that was my solution for the homework. >>> >>> It is the extra credit part that is worthy of discussion. >>> >> >> >> BTW - I don't like the use of statics in these functions. What if you >> have to count twice? It is better to declare the variable outside the >> function and then either pass it in by reference or use make an external >> reference or pointer to the external counter. This way you can zero it >> if you need to. >> >> Ruben
|
|