Category Archives: Dynamic Programming

Top 20 Dynamic Programming Interview Questions

Dynamic Programming is an algorithmic paradigm that solves a given complex problem by breaking it into subproblems and stores the results of subproblems to avoid computing the same results again. Following are the most important Dynamic Programming problems asked in various Technical Interviews. ‘Recent Articles’ on Dynamic Programming ‘Coding Problems’ on Dynamic Programming ‘Quiz’ on… Read More »

Digit DP | Introduction

Prerequisite : How to solve a Dynamic Programming Problem ? There are many types of problems that ask to count the number of integers ‘x‘ between two integers say ‘a‘ and ‘b‘ such that x satisfies a specific property that can be related to its digits. So, if we say G(x) tells the number of… Read More »

Tabulation vs Memoizatation

Prerequisite – Dynamic Programming, How to solve Dynamic Programming problems? There are following two different ways to store the values so that the values of a problem can be reused. Here, will discuss two patterns of solving DP problem: Tabulation: Bottom Up Memoization: Top Down Before getting to the definitions of the above two terms… Read More »

How to solve a Dynamic Programming Problem ?

Dynamic Programming (DP) is a technique that solves some particular type of problems in Polynomial Time. Dynamic Programming solutions are faster than exponential brute method and can be easily proved for their correctness. Before we study how to think Dynamically for a problem, we need to learn: Overlapping Subproblems Optimal Substructure Property Steps to solve… Read More »

Find number of endless points

Given a binary N x N matrix, we need to find the total number of matrix positions from which there is an endless path. Any position (i, j) is said to have an endless path if and only if all of the next positions in its row(i) and its column(j) should have value 1. If… Read More »