» » 333 brunette teen dp runtime

# 333 brunette teen dp runtime HD

The impulsive programming formula for the rucksack trouble has a time complexness of $O(n W)$ wherever $n$ is the routine of items and $W$ is the capacity of the knapsack. I have read that one needs $\lg W$ bits to represent $W$, so it is exponential time. But, I don't understand, one also needs $\lg n$ bits to equal $n$, doesn't one? This is wherever the argument about $\log W$ comes in. So, for example, merge person is not polynomial time, because its quality is $O(n\lg n)$ and one needs $\lg n$ to stand for $n$? Ignoring the value of the items for the consequence (and considering lone their weights), the input of the knapsack problem is $n$ numbers $\leq W$.

## Upper Bound on Runtime of Memoized DP Algorithms - Computer Science Stack Exchange

I brainstorm it fairly easy to return an upper tied for just about any repetitious mixture (e.g. look at the limits on for each one loop, etc.), and can oftentimes create an upper conjugated for normal algorithmic functions. However, I am now trying to determine a "Big-O" for a DP problem I've memoized.