MESSAGE
DATE | 2015-02-19 |
FROM | Ruben Safir
|
SUBJECT | Re: [LIU Comp Sci] Hwk4 Allorithms
|
From owner-learn-outgoing-at-mrbrklyn.com Thu Feb 19 10:40:40 2015 Return-Path: X-Original-To: archive-at-mrbrklyn.com Delivered-To: archive-at-mrbrklyn.com Received: by mrbrklyn.com (Postfix) id 2B7C716130D; Thu, 19 Feb 2015 10:40:40 -0500 (EST) Delivered-To: learn-outgoing-at-mrbrklyn.com Received: by mrbrklyn.com (Postfix, from userid 28) id 1C04116130F; Thu, 19 Feb 2015 10:40:39 -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 7D71F16130D for ; Thu, 19 Feb 2015 10:40:38 -0500 (EST) Received: from [10.0.0.19] (unknown [96.57.23.82]) by mailbackend.panix.com (Postfix) with ESMTPSA id AFBA112E3E for ; Thu, 19 Feb 2015 10:40:38 -0500 (EST) Message-ID: <54E603F5.7000308-at-panix.com> Date: Thu, 19 Feb 2015 10:40:37 -0500 From: Ruben Safir 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] Hwk4 Allorithms References: In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: owner-learn-at-mrbrklyn.com Precedence: bulk Reply-To: learn-at-mrbrklyn.com
On 02/19/2015 09:53 AM, keisha.sylvester wrote: > Ruben you coming to class later? >
I don't have class today but I'll be on campus after 2PM. I want to go for a swim and maybe see if I can find someone to study with.
Tonight I have a meeting in Manhattan for NYLXS to help with the Technology Journal they have.
Ruben > > > Sent from Samsung tabletRuben Safir wrote:This assignment is so small that I don't want to post my answer > but I will say that 5 => 51, I think, if I understnad this correctly. > I'm not sure exactly what he wants written here and he can be a PIA. > > I ASUME that we are starting with n = 0 > > I hope that is right. Meanwhile, FWIW, here is a slight reworking of > the examples in the notes. > > http://www.nylxs.com/docs/grad_school/algorithms/Hwk4/recursions/ > > the main part looks like this > > #include "recursion.h" > #include > > long recursion(long in) > { > long ctch; > if (in < 2){ > std::cout << in << std::endl; > return 1; > } > ctch = ( in * recursion(in - 1)); //count down to zero > std::cout << in << " " << ctch << std::endl; > return ctch; > } > > long buffer[5000] = {0}; > > long fib(long in) > { > //long ctch; > // std::cout << "a => " << in << std::endl; > > if (buffer[in] != 0){ > return buffer[in]; > } > > if(in < 3){ > std::cout << in << "| 1" << std::endl; > buffer[in] = 1; > return 1; > } > //ctch = (fib(in - 1) + fib( in - 2) ); > buffer[in] = (fib(in - 1) + fib( in - 2) ); > std::cout << in << " " << buffer[in] << std::endl; > return buffer[in]; > } > > > If anyone has trouble, call me before 10 minutes before class or email > the list > 718-715-1771 > > > Ruben
|
|