Dynamic Programming for Coding Interviews: A Bottom-Up Approach to Problem Solving
Dynamic Programming for Coding Interviews: A Bottom-Up Approach to Problem Solving
Rawat, Kamal
product information
Condition: New, UPC: 9781946556691, Publication Date: Sun, January 1, 2017, Type: Paperback ,
join & start selling
description
1I wanted to compute 80th term of the Fibonacci series. I wrote the rampant recursive function,

int fib(int n){

return (1==n -- 2==n) ? 1: fib(n-1) + fib(n-2);

}

and waited for the result. I wait... and wait... and wait...

With an 8GB RAM and an Intel i5 CPU, why is it taking so long? I terminated the process and tried computing the 40th term. It took about a second. I put a check and was shocked to find that the above recursive function was called 204,668,309 times while computing the 40th term.

More than 200 million times? Is it reporting function calls or scam of some government?

The Dynamic Programming solution computes 100th Fibonacci term in less than fraction of a second, with a single function call, taking linear time and constant extra memory.

A recursive solution, usually, neither pass all test cases in a coding competition, nor does it impress the interviewer in an interview of company like Google, Microsoft, etc.

The most difficult questions asked in competitions and interviews, are from dynamic programming. This book takes Dynamic Programming head-on. It first explain the concepts with simple examples and then deep dives into complex DP problems.

reviews

Be the first to write a review

member goods

No member items were found under this heading.

notems store

PHP 8 Objects, Patterns, and ...

by Zandstra, Matt

Paperback /Paperback

$37.49

Illustrated Guide to Python 3: ...

by Harrison, Matt

Paperback /Paperback

$17.47

Make: AI Robots: Create Amazing ...

by Richard, Reade

Paperback /Paperback

$18.74

listens & views

DUO SONATAS 3

by MOZART / DUO AMADE

COMPACT DISC

$11.49

TRANSATLANTIC

by POTTER,CHRIS AND DR BIG BAND

COMPACT DISC

out of stock

$17.75

ADVENTURES IN PARADISE

by WAITIKI 7

COMPACT DISC

out of stock

$16.25

NEON SOUNDLOUNGE

by CAPRICE,CEEZA

COMPACT DISC

out of stock

$13.75

Return Policy

All sales are final

Shipping

No special shipping considerations available.
Shipping fees determined at checkout.
promoting relevance through notable postings ]

A notem is a meaningful post that highlights an experience, idea, topic of interest, an event ... whatever a member believes worthy of discussion. Each notem becomes a pathway by which to make meaningful connections.

notems is a free, global social network that rewards members by the number and quality of notems they post.

notemote® © . Privacy Policy. Developed by Hartmann Software Group