Implementing Recursion Ideas into Code | Day 1 Part 2 | Dynamic Programming workshop | Vivek Gupta

preview_player
Показать описание
In this DP workshop, we are going to learn many DP formulations that are going to make solving DP problems easy for you. Register today if you haven’t.

✨ Hashtags ✨
#7daysofDP #VivekGupta #dpworkshop #CPStreams #codechef #codeforces #engineering #internship #DSA
-------------------------------------------------------------------------------------------------------------

If you are a beginner, here are some resources to start with :

If you are looking to train in a commado like regime for acing DSA (with DEV and System Design covered for placement too), do checkout :

Рекомендации по теме
Комментарии
Автор

that diagonal check using absolute value of previous and current row/column was mindblowing...O(1)

codingwithanonymous
Автор

This is one of the most optimal ways to solve with a framework bhai ko as if pata hai ki exactly kidhar we'll get stuck and he has shown us the way to think on that using his LCCM method

Super bhai

radicalengineer
Автор

diagonal trick is came from mathematiics slope formula, as we know diagonal are at an angle of 45 degree, so tan 45 is 1. then our formula will become like that condition

utkarshpandey
Автор

that diagonal check trick is awesome....that why if some one knows recursion still i said to watch vivek sir videos u will get new things in your bag

AmanTheMystery
Автор

Loved this video, specially the check to place the queen till now I was always writing 3 loops in my check function 😂

Sandeep-zddq
Автор

Maze aa gye bro 🔥N-Queens ekdum samajh aa gya. Thanks a lot for the good work, keep it up 👍🏼 full support

akshatmehra
Автор

why this video is not getting millions views.. this is the best explanation..

CREATIONTIME
Автор

Super easy to understand with LCCM method!!!

anjumankhan
Автор

dont know how you manage the recording and your job thank you for the videos

abhishek
Автор

Hii sir, my friend gave me your algozenith course and another friend (6* on codechef) told me to learn dp from here. When I heard your voice i was like 🤯🤯 this man. All I want to say is your explanation is very elaborate and easy to understand. Never understood dp this way. Thanks for the effort., ❤️

leftover
Автор

we can think of this as :
prow, pcol = x1, y1 // co-ordinates
row, col = x2, y2
(y2 - y 1) / ( x2 - x1) = slope
for diagonal - its 45 degree so tan theta = +, -1
|y2-y1| / |x2 - x1| = 1
|y2-y1| = |x2 - x1|, which is actually abs(y2-y1) = abs(x2-x1)

amartyachand
Автор

note for me:
see, the approach i can think for last problem is that
we will declare penalty as global variable starting from zero, then we will write the rec function with level starting from zero and going till n and we will declare n as k+1, we will also make an array of size k+1 which will store the area of each part because k tear will result in k+1 parts, when the base case will hit that is level==n, then we will find penalty=min(penalty, current penalty) where current penalty will be sum of square of elements of array, now for the tear part that how we will tear, what i thought was we will use two recursion loops, one will tear horizontally and other will tear vertically

this is not complete but this was my first thought hit in 2 minutes after seeing the problem

noone
Автор

Bro ye shi tarika hai video ko question k saath end krne ka 😂 ab ruka hi nhi jaa rha isko solve toh krke rahunga 😎 because it’s a new question for me 🔥

Sandeep-zddq
Автор

can anyone explain what we are doing at 22:49, how we are saving the position of previous queens?

smile_please
Автор

Hey Vivek, Everytime writing the base case first is necessary or how do you think when it comes to base cases?

akshayshah
Автор

need some more calrity on the reverting the choices part.

codemode
Автор

last problem is based on dp on partition, as we can cut at any co-ordinate of the grid. Correct me, If I'm wrong.

saranghae
Автор

N-queen best: i've done this by myself after watching the video (in leetcode there is more on this problem )

Profnegi
Автор

bhaiya can u decrease the font of the code so that we can see the all the code of one function in one time so that we can get the intution of the function more easily.Overall your content is amazing.

abhi_
Автор

in que 3 why we have not taken the values itemTaken and timeTaken along with recursive

AKASHKUMAR-lili
visit shbcf.ru