Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1’s in their binary representation and …
The thief has found himself a new place for his thievery again. There is only one entrance to this area, called the “root.” Besides the root, each house has …
The Matrix Chain Multiplication Problem is the classic example for Dynamic Programming. If there are three matrices: A, B and C. The total number of multiplication for (A*B)*C and …
April 15, 2015
algorithms, BFS, Breadth First Search, c / c++, Depth First Search, DFS, Dynamic Programming, dynamic programming, Memoization, python, Recursion
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each …
Given an index k, return the k-th row of the Pascal’s triangle. For example, given k = 3, Return . Could you optimize your algorithm to use only O(k) …