Posts

Showing posts from April, 2020

EduBhogi Video Demo

Image

Stolen

"Three minutes to the train" thought Rakesh. It had been a tiring day for him. His job at the dockyard which was initially hard on him had gotten easier with time. Earlier it was a strange caricature of decay and resurrection but after his first salary credit a few days back the same structure turned into sweating smell of hope. Somehow he had found home in blood metal sound of machines and ocean blue water and skies. He did not particularly enjoy coming to the railway station though. The railway station always made him envious of lives other people had, Families, saying affectionate goodbyes, girlfriends holding hands with their boyfriends, a group of young men cackling with laughter and merriment. It was this envy that made him buy an expensive new smartphone with his first salary. He wanted to be more confident amongst the crowd around him. He had already imagined himself standing beside the pole of Mumbai local train, earphones in his ears and the wind blowing through hi

Dynamic Programming

Image
In this blog post we will discuss various dynamic programming questions. The idea is to have a same template to understand all the dynamic programming problems. All the problems that we discuss will be divided into four parts:- What is the question?  ( read * 2 times )  Why this problem can be solved with the help of Dynamic Programming? ( read once ) What does dp[i][j] or dp[i] mean with respect to the question? ( read once ) What is the solution if the assumed dp array is to be constructed? ( read once ) How the dp[i] or dp[i][j] will be formulated? Along with the help of an example. ( read twice ) Variations to the questions  Once these algorithms are done, we will observe that even the new problems can be solved with the help of this template. I have used same terminology to make the questions easier.  1. Longest Common Subsequnce QUESTION : Given two sequences, find the length of longest subsequence present in both of them. In the code given below we assume X,