Ep11- Combinations | Find all possible combinations of k numbers out of the range 1 to N | Recursion

preview_player
Показать описание
Today, we are going to do a very interesting problem 'Combinations' which will help you to solve many other similar types of problems. Don't miss this lecture and watch it till the end. Also summarize the whole video in 4-5 lines and put it in the comments.

To get all updates follow on Instagram

👨‍💻Utilize free courses, DSA sheet, and articles on Lead Coding website at

Join our telegram channel for all the important announcements

✨ Hashtags ✨
#DSA #Recursion #Placement #Fraz
Рекомендации по теме
Комментарии
Автор

Summarization:
1. Generate all subsets and add size of k into the ans
2. discard all the subsets more than size of k
3. skip the combinations which may not have chance to get of k elements.

manojgollapelli
Автор

Thanks for the lectres bhaiya,
I understood the whole thing,
Here is the summary for today's lecture..

1. Think of generating all the subsets of size k,
2. Think of the base case carefully(it can help us optimize the code)
3. Use the I&I method(include and ignore )

de_ansh
Автор

I would start enjoying with Recursion from when Fraz bhaiya would start teaching about alot bhaiya!!

DPCODE
Автор

Although I have never used that smaller condition but it really gives a lot more clarity and one thing also that this pick/non-pick strategy will always used when your answer is of smaller size as compared to input because then only you have the option to not-pick otherwise if it would be the permutations then answer is of same size therefore you can’t use it there.

Sandeep-zddq
Автор

I think space complexity will also be O2^n as in worst case 2^n recursion calls will be stored in recursion call stack

sidhant_khamankar
Автор

Done Day 11
start from i=1 and include the number meanwhile decrement k and increment i
pop the element i and increment the i and if at any point i>n && k==0 add the subset to the ans arraylist and return it

hiiiiiiii
Автор

Really enjoyed solving the problem together.

priyanshjha
Автор

Bhaiya aapke Recursion ka video Dekh ke lagta hai ki,
Sare Data Structure Chor Ke Kewal Recursion hi Padhu.
It's amazing videos

codeflix
Автор

amazing explanation bhaiya because of you I am loving recursion

beTheChange
Автор

In Combination problem we basically consider all subsets of size 2, after that we start bounding the solution as soon as size of ans become equals to k we add that ans to our result and as the condition we get the required element is greater than the remaining element we return from that point, these help in reducing the time complexity but worst case time complexity is same as O(2^n)

harshjain
Автор

This series is verry helpfull and i read verry more understanding so i will place in 30 days. ❤‍🔥❤‍🔥❤‍🔥❤‍🔥

webtechnology
Автор

lecture 11 done 😍😍😍👌👌🤞 waiting for the next episode 🖤🖤🖤🖤

anuraggulati
Автор

Bro excellent lecture again and the intuition behind the question helps me to get the question done by me without seeing the solution ❤❤❤❤❤❤❤❤❤❤❤❤❤❤

it_amanagarwal
Автор

Bhaiya ur lectures are awsome but can u plz make a video on "Time & Space complexity" as i am finding it difficult.
And its a humble request to make the video before 31st May (ie before the Contest), if possible/-

kartikeyrai
Автор

How many lectures for recursion are remaining? Please please tell

hritikasharma
Автор

1.base case
2.take the element
3.backtrack
4.ignore the element

shashankkr
Автор

Selecting all the subsets of size k value from n.
1.Take the element -> k-1, Skip the element ->k.
2.Base conditions:
(i) if we reach k==0, then push subset into ans and return.
(ii) if k value is greater than remaining elements in n (n-i+1) then return.
(iii) if current(i) value greater than n we return.

dhruvbharara
Автор

My Summarization:
Selecting all the subsets of size k value from n.
1.Take the element -> k-1, Skip the element ->k.
2.Base conditions:
(i) if we reach k==0, then push subset into ans and return.
(ii) if k value is greater than remaining elements in n (n-i+1) then return.
(iii) if current(i) value greater than n we return.

saipradeepkatakam
Автор

wonderful explanation recursion looking easy

TravelTracksByDebo
Автор

Thanks Fraz for the entire recursion series.

RaunakShrivastava