Velocity Reviews > How to calculate Fibonacci with template?

# How to calculate Fibonacci with template?

Helong Feng
Guest
Posts: n/a

 01-21-2013
to ensure the complexity is O(1).THX~

bert
Guest
Posts: n/a

 01-21-2013
On Monday, 21 January 2013 10:11:58 UTC, Helong Feng wrote:
> to ensure the complexity is O(1).THX~

Work out your own recurrence relation which
approximately doubles the index at each step.
{F} = ... 3, 5, 8, ... 55, 89, ...
and: 55 = 8^2 - 3^2, 89 = 8^2 + 5^2.
--

Noob
Guest
Posts: n/a

 01-21-2013
Helong Feng wrote:

> How to calculate Fibonacci with template to ensure
> the complexity is O(1)

There are no templates in C.

Kenny McCormack
Guest
Posts: n/a

 01-21-2013
In article <kdjbrb\$30k\$(E-Mail Removed)>, Noob <root@127.0.0.1> wrote:
>Helong Feng wrote:
>
>> How to calculate Fibonacci with template to ensure
>> the complexity is O(1)

>
>There are no templates in C.
>

But there is in C/C++/C# - which is what most people really mean nowadays
when they refer to "C".

--
Nov 4, 2008 - the day when everything went
from being Clinton's fault to being Obama's fault.

Les Cargill
Guest
Posts: n/a

 01-21-2013
Kenny McCormack wrote:
> In article <kdjbrb\$30k\$(E-Mail Removed)>, Noob <root@127.0.0.1> wrote:
>> Helong Feng wrote:
>>
>>> How to calculate Fibonacci with template to ensure
>>> the complexity is O(1)

>>
>> There are no templates in C.
>>

>
> But there is in C/C++/C# - which is what most people really mean nowadays
> when they refer to "C".
>

I don't think anybody confuses C# with the other two. C# was
specifically designed as a heresy on C++ - for "the language

--
Les Cargill

Kenny McCormack
Guest
Posts: n/a

 01-21-2013
In article <kdjfmu\$q03\$(E-Mail Removed)>,
Les Cargill <(E-Mail Removed)> wrote:
>Kenny McCormack wrote:
>> In article <kdjbrb\$30k\$(E-Mail Removed)>, Noob <root@127.0.0.1> wrote:
>>> Helong Feng wrote:
>>>
>>>> How to calculate Fibonacci with template to ensure
>>>> the complexity is O(1)
>>>
>>> There are no templates in C.
>>>

>>
>> But there is in C/C++/C# - which is what most people really mean nowadays
>> when they refer to "C".
>>

>
>
>I don't think anybody confuses C# with the other two. C# was
>specifically designed as a heresy on C++ - for "the language

Heh heh. I hear ya. And I did just throw in the C# reference to further
annoy the regs here - as if the sight of those 2 plus signs following the
name of their beloved language wasn't enough.

But, seriously folks, from what I hear, in the "business" world these days,
C# *is* pretty much considered to be the current incarnation of C. Even C++
is considered to be a "legacy language".

--
People who say they'll vote for someone else because Obama couldn't solve
all of Bush's messes are like people complaining that he couldn't cure cancer,
so they'll go and vote for cancer.

Shao Miller
Guest
Posts: n/a

 01-21-2013
On 1/21/2013 09:41, Kenny McCormack wrote:
> In article <kdjfmu\$q03\$(E-Mail Removed)>,
> Les Cargill <(E-Mail Removed)> wrote:
>> Kenny McCormack wrote:
>>> In article <kdjbrb\$30k\$(E-Mail Removed)>, Noob <root@127.0.0.1> wrote:
>>>> Helong Feng wrote:
>>>>
>>>>> How to calculate Fibonacci with template to ensure
>>>>> the complexity is O(1)
>>>>
>>>> There are no templates in C.
>>>>
>>>
>>> But there is in C/C++/C# - which is what most people really mean nowadays
>>> when they refer to "C".
>>>

>>
>>
>> I don't think anybody confuses C# with the other two. C# was
>> specifically designed as a heresy on C++ - for "the language

>
> Heh heh. I hear ya. And I did just throw in the C# reference to further
> annoy the regs here - as if the sight of those 2 plus signs following the
> name of their beloved language wasn't enough.
>

I don't understand why you'd want to do that.

> But, seriously folks, from what I hear, in the "business" world these days,
> C# *is* pretty much considered to be the current incarnation of C. Even C++
> is considered to be a "legacy language".
>

It's fun that the '#' can be decomposed into 4 tiny '+' signs, perhaps
resulting an operation like: (c++)++ Unfortunately, that operation
doesn't work, in C.

--
- Shao Miller
--
"Thank you for the kind words; those are the kind of words I like to hear.

Cheerily," -- Richard Harter

Noob
Guest
Posts: n/a

 01-21-2013
Shao Miller wrote:

> I don't understand why you'd want to do that.

I don't understand what you don't understand.

Trolls will be trolls.