Showing posts with label Recurrence. Show all posts
Showing posts with label Recurrence. Show all posts

Monday, May 27, 2013

SPOJ LOOPEXP

Link : LOOPEXP

Category : Maths, Expectation


Hint : Consider the smallest element of the array. Consider the two cases of it being the first element of the array and not being the first element of the array.

Code:

Tuesday, January 8, 2013

SPOJ SKYLINE

Link : SKYLINE

Category :Maths


Solution : Recurrence works out to be Catalan number.


Code: