The tag has no wiki summary.

learn more… | top users | synonyms

3
votes
2answers
166 views

Isn't Functional Programming just Imperative Programming in disguise?

A YouTube video I was watching explained the differences between Imperative and Functional programming by demonstrating how the numbers from 1 to ...
1
vote
1answer
268 views

Asymptotic time complexity of a two-loop program

I have two pieces of code in a function which I'm trying to calculate the asymptotic running time for: ...
6
votes
5answers
4k views

Is it possible to find the nth term of a Fibonacci sequence using a definitive for loop?

I'm using the book Introduction to Computer Science by John Zelle and at the end of Chapter 3 (Computing with numbers), I'm asked to find the nth term of a Fibonacci sequence presumably using a ...
5
votes
1answer
158 views

termination of two concurrent threads with shared variables

We're in a shared memory concurrency model where all reads and writes to integer variables are atomic. do: $S_1$ ...
2
votes
1answer
206 views

Double-nested loop with bitwise operation

I have this little exercise: for ( i = 0; i < 2 * n; i += 2 ) for ( j = 1; j <= n; j <<= 1 ) if ( j & i ) foo (); (...