Maths for DSA/CP : All You Need To Know

  Рет қаралды 147,886

Utkarsh Gupta

Utkarsh Gupta

Күн бұрын

Пікірлер
@debjitdasgupta5502
@debjitdasgupta5502 3 жыл бұрын
Don't stop the DSA/CP series! Amazing video as usual!!
@harshpandey4190
@harshpandey4190 Жыл бұрын
Best Video on number theory by Best of the Community
@girishbhargava6367
@girishbhargava6367 3 жыл бұрын
I really respect the people who add time stamps in their videos
@sivasainagireddi7956
@sivasainagireddi7956 3 жыл бұрын
Exactly this is what I m searching for for. GREAT EXPLANATION
@SunilKumarGvBLC
@SunilKumarGvBLC 3 жыл бұрын
In 24:03, while explaining sieve of eratosthenes, the upper for loop should go from 2 to i * i
@utkarshgupta9858
@utkarshgupta9858 3 жыл бұрын
The time complexity is still the same... Plus my template also stores all of the primes in a vector, so that's why i < N
@SunilKumarGvBLC
@SunilKumarGvBLC 3 жыл бұрын
Got it brother! Thanks for your instant reply!
@sachinupreti7159
@sachinupreti7159 2 жыл бұрын
@@utkarshgupta9858 sun yr, bit manipulation pe bhi sikha de kuxh...
@justworkfine321
@justworkfine321 2 жыл бұрын
So you mean constant not matter I*i we get const value and for big o for worst case we can't consider constant so it's complexity O(n) times
@shantivaranasi231
@shantivaranasi231 2 жыл бұрын
@@utkarshgupta9858 can u share related problems of these topics
@bugSlayer07
@bugSlayer07 3 жыл бұрын
Not all heroes wear capes.. Some make DSA videos on YT. Thanks brother 🙌
@harshit_gajera
@harshit_gajera 2 жыл бұрын
At 45:50, if b==0, you should return 1; this code gives the wrong answer in some test cases. ex= 9 1 7 Thank you. Waiting for the next video.
@surajkumar-ze5jl
@surajkumar-ze5jl 3 жыл бұрын
I am in mid of CP course of coding ninja and I recently going with topic of number theory and almost mujhay meri kashti dubti nazar aarahi this but is video ne meri kasti sambhal li modulo arithmetic part is awesome for me thank you Utkarsh bhaiya.
@Atvkaur1111
@Atvkaur1111 3 жыл бұрын
CP course is paid or free?
@anilcoder
@anilcoder 3 жыл бұрын
Wow! Modulo inverse and Fermat theorem Explanation I will never forget, ❤❤❤❤.
@pksk7952
@pksk7952 3 жыл бұрын
please make more videos please increase the frequency as this is kind of content we want!
@shri9229
@shri9229 3 жыл бұрын
He is INDIA RANK 2 Bro
@sachinupreti7159
@sachinupreti7159 2 жыл бұрын
@@shri9229 now 1 🤦‍♀️
@tessabloomx8660
@tessabloomx8660 3 жыл бұрын
hey in your binary exponentiation (pw) function, in the base case if b is 0 then we should return 1 as a^b will become 1 and m is assumed to be greater than 1.
@utkarshgupta9858
@utkarshgupta9858 3 жыл бұрын
Yes you're right... I made a typo in the code.
@Studykrobetaplz
@Studykrobetaplz 3 жыл бұрын
Oh finally you are back 😊 :))) much more love to you bhaiya
@AviralDewan
@AviralDewan 3 жыл бұрын
Bro please make a video on dynamic programming
@algoJamming
@algoJamming 3 жыл бұрын
I think ,he already have some videos on dynamic programming :)
@SKgaming-qy6gn
@SKgaming-qy6gn 3 жыл бұрын
Watch striver's channel
@satyammishra2783
@satyammishra2783 3 жыл бұрын
Practice
@tirthasg
@tirthasg 3 жыл бұрын
Your explanations are great. Well done!
@shubhamchidrawar9477
@shubhamchidrawar9477 2 жыл бұрын
Awesome video! This is very high quality content, Eagerly waiting for the second part.
@DeepakKumar-mn7sp
@DeepakKumar-mn7sp 3 жыл бұрын
How to setup sublime like that in 5:30 , the TC part ?
@saurabhkumarchoudhary1795
@saurabhkumarchoudhary1795 3 жыл бұрын
This is the thing I was waiting from past 4 years
@jayantgupta5310
@jayantgupta5310 3 жыл бұрын
Literally bhaiya I was finding this type of video for 2-3 days and nothing got quality content like this Thanks a lot Aapne meri sun li
@Profnegi
@Profnegi Жыл бұрын
Today i start cp and learning from grandmaster directly.. like wow this is amazing! Lot of resp++
@deepakbhoria4172
@deepakbhoria4172 Жыл бұрын
thanks for explaining modulo arithmetic in full details !!! great work
@apoorvamittal4112
@apoorvamittal4112 3 жыл бұрын
just the person I was looking for, thanks 🙌
@utkarshgupta9858
@utkarshgupta9858 3 жыл бұрын
Person or video? 😛
@anveshreddypinnapareddy3552
@anveshreddypinnapareddy3552 3 жыл бұрын
@@utkarshgupta9858 Ig the "person" who can make many such "videos".
@priyankarai7005
@priyankarai7005 2 жыл бұрын
How come we feel the same ❤️❤️ the one I was looking for
@ANANDKUMAR-jk9yp
@ANANDKUMAR-jk9yp 3 жыл бұрын
By the way, time complexity of gcd is log(min(a,b)).
@shresthjain985
@shresthjain985 3 жыл бұрын
Crisp and to the point content. Well Done.
@AkhileshSingh-wq6gt
@AkhileshSingh-wq6gt 3 жыл бұрын
Thank you Bhaiya... Modular Arithmetic part taught me something new.. 😊
@abhishekmore5856
@abhishekmore5856 Жыл бұрын
Really liked your explanations and proofs for n/1, n/2 , n/3, ....n/n = logn Intuition why sieve inner loop starts at i*i and the way you improved the complexity o(n), o(sqrt(n)), for queries o(n*loglogn) Intuition of mod operations ( +, -, *, /) and why / wont work like other. o(1) calculation of inverse m! ( it looked obvious after you explained XD ) m/m! -> 1/(m-1)!
@theresweet984
@theresweet984 3 жыл бұрын
Hola, Utkarsh Gupta! Please keep it up this kind of competitive edu series. Thanks!
@jitendrakhanna4426
@jitendrakhanna4426 3 жыл бұрын
From where you learn all these things or just while practicing you learn..
@abhijeetbasfore6816
@abhijeetbasfore6816 3 жыл бұрын
Cpalgorithms
@tusharamreliya5250
@tusharamreliya5250 Жыл бұрын
pre rmo
@aryankumar87771
@aryankumar87771 Жыл бұрын
for prime approach would this be not much faster ? bool isPrime(int N) { if(N==1){ return false; } int count = 0; for(int i = 1; i*i
@ritvikreddy3959
@ritvikreddy3959 Жыл бұрын
removing the nested if won't reduce the time complexity it will still be O(root(n))
@himanshu010
@himanshu010 3 жыл бұрын
Gread content Grandmaster. Keep uploading. 🤝
@murtazamister8125
@murtazamister8125 2 жыл бұрын
Modular division at 55:35 for these two cases are not returning equal output, a=48521 b=654 m=17 output : 6 11 a=48521 b=654 m=13 output : 9 11 Is it only happening with me? or they do produce different output?
@aayushverma5121
@aayushverma5121 3 жыл бұрын
Just the content I was looking for ! Thank you for the video
@ananyasuryavanshi2800
@ananyasuryavanshi2800 2 жыл бұрын
Please make one whole video explaining time-complexity also.
@vivekdhir77
@vivekdhir77 3 жыл бұрын
Nice, bro long time no see. I was waiting.....
@Manish_Upadhyay
@Manish_Upadhyay 3 жыл бұрын
You are inspiration for me ❤️✨
@codenchill732
@codenchill732 3 жыл бұрын
Please make a video on bit manipulation. Especially on XOR operation
@yath3681
@yath3681 3 жыл бұрын
yes , please ! everything about bitwise operator questions in CP
@vtechrepo1927
@vtechrepo1927 3 жыл бұрын
after so long wating for this video
@RahulSingh-nf3dr
@RahulSingh-nf3dr 2 жыл бұрын
27:50 time complexity should be O(log(min(a,b))) correct me if I am wrong
@AshishGusain17
@AshishGusain17 3 жыл бұрын
42:21 shouldn't base case return 1
@zarifishmam809
@zarifishmam809 4 ай бұрын
at 24:15, can someone explain why he does the primes[i] ^= 1? what does that achieve?
@Ram-uf8mv
@Ram-uf8mv 3 жыл бұрын
in pw(a, b, m), when b is 0, why are you returning a % m? it should always be 1 right?
@utkarshgupta9858
@utkarshgupta9858 3 жыл бұрын
Oh right yeah... I think I mistyped that part... And the tests didn't fail🤦🏻‍♂️ I hope learners don't get confused. Thanks for pointing out
@rajukachori9536
@rajukachori9536 3 жыл бұрын
SIR UR DOING GREAT JOB FOR US ...THANKU PLEASE MAKE MORE THIS VIDEOS .WE GET TO LEARN MANY THINGS FROM IT
@Advebtures-hx4hv
@Advebtures-hx4hv 3 жыл бұрын
Please make a video for greedy it is very helpful
@parthsalat
@parthsalat 2 жыл бұрын
Amazing content, as usual!
@DeepakKumar-mn7sp
@DeepakKumar-mn7sp 3 жыл бұрын
At 23:55 that sieve template, how the whole template code arrives just by typing sieve?
@TON-108
@TON-108 3 ай бұрын
In vs code we can save boilerplate codes
@allmighty2000
@allmighty2000 2 жыл бұрын
the nlogn proof was amazing
@tejaswarade3785
@tejaswarade3785 2 жыл бұрын
can you please give practice problems on Maths part in DSA
@dhananjaysharma4379
@dhananjaysharma4379 3 жыл бұрын
very nice explanation, just adding the practice questions related to the concepts would be even better.
@sandeepsharma2183
@sandeepsharma2183 3 жыл бұрын
Most awaited video♥️♥️
@rahul_singh_rajput3292
@rahul_singh_rajput3292 3 жыл бұрын
Bhaiya plS make video on how to Start for CP.. How should we learn Dsa correcr way
@abhishekkeshri3974
@abhishekkeshri3974 3 жыл бұрын
Thanks for this. It really helps me a lot .
@arnabchakraborty246
@arnabchakraborty246 3 жыл бұрын
Grt video. Please share some problem set to practice
@codeblooded6760
@codeblooded6760 3 жыл бұрын
Hey recently saw your mock interview with kerthi purswani in which you mentioned that hard ques will most probably be not asked in google interviews. Can you make a detailed video about the difficulty level of ques that can be asked in google interviews with examples of some questions so we can get a good idea about the level of ques asked. Also if you could compare them with respect to leetcode medium and hard questions that would be very helpful. Thanks in advance!
@jiakai7254
@jiakai7254 Жыл бұрын
if you prefer a textbook, consider the competitive programmers handbook :)
@wondol4486
@wondol4486 3 жыл бұрын
This is perfect lecture
@random_memes009
@random_memes009 3 жыл бұрын
Hwy, plz make video on time complexity. Thk yu for helping us
@manayyadav4911
@manayyadav4911 3 жыл бұрын
Hey, could you please make a video on how to setup sublime text for cp on windows. It's really frustating for windows peeps to execute and run programs.
@humanbeing6042
@humanbeing6042 3 жыл бұрын
Checkout Luv competitive programing course playlist.The second video completely about setup Link: kzbin.info/www/bejne/kJ3baJqjqZifeLc
@manayyadav4911
@manayyadav4911 3 жыл бұрын
@@humanbeing6042 I have already seen it. But not able to setup from his way. I am not able to make my custom build file and stuck forever :(
@johntony366
@johntony366 2 жыл бұрын
You can use WSL to get the linux experience on windows
@PrinceKumar-uz9xv
@PrinceKumar-uz9xv 3 жыл бұрын
thanks, ❤ bhaiya I wanted this type of video.
@ascyrax8507
@ascyrax8507 3 жыл бұрын
I used to dread Modular multiplicative inverse. Not anymore 😌
@AtulKumar-c4x7l
@AtulKumar-c4x7l Жыл бұрын
primality test 3:27 gcd 24:37 modular arithmetic 30:52 pnc 59:04
@sherlockjunior8612
@sherlockjunior8612 Жыл бұрын
Prime or not Prime Number of divisors of each number from 1 to N Sieve of Erastothenes GCD Modular Aritihmetic ( Add, Subtract, Multiply, Pow(Binary Exponentiation), Fermat's Little Theorem to get (1/a)%M we get pow(a,M-2)%M where M is prime number divisor, ) Combinatronics: nCr calculation in linear time using fact and inv_fact array (Usually paired with %M problems)
@arsh2489
@arsh2489 Жыл бұрын
this video changed my life beta 👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌
@Nikhil-Tomar
@Nikhil-Tomar 10 күн бұрын
I don't think +m is required in ((a % m) - (b % m) + m) % m, because even if (a % m) - (b % m) < 0, In this case this value has to be % by the outer m, There it will always reach a positive number.
@Sandeep-zd6dq
@Sandeep-zd6dq 3 жыл бұрын
Bhai mujhe bhi 7 star banna hai 😢 jbse tumhari AIR 1 waali video dekhi hai tumhe follow kr rha hu lekin abhi 3 start bna hu 1 mahine mein😎 jaldi hi seven bhi bnunga
@cypher7536
@cypher7536 3 жыл бұрын
Bro please tell how to make sublime like yours
@samanwaybarman3316
@samanwaybarman3316 3 жыл бұрын
Searching and sorting and precomputation
@rishav144
@rishav144 3 жыл бұрын
kindly continue with Graph series
@TilakRaj-qo6ic
@TilakRaj-qo6ic 8 ай бұрын
Can someone please tell me which software he used to create thie presentation please
@abhinavkumar5298
@abhinavkumar5298 Жыл бұрын
Amazing Video.
@sahilanand30
@sahilanand30 3 жыл бұрын
Nice explanation
@muthupandideivamsanmugam1774
@muthupandideivamsanmugam1774 Жыл бұрын
I have one doubt if we multiply a number it gets overflow and if we add also it gets overflow but if we divide a number how it will get overflow
@yashkhatwani3198
@yashkhatwani3198 3 жыл бұрын
Hi Utkarsh how are you getting all that , test , run ,edit , time and stop feature in your editors output
@shubh4096
@shubh4096 3 жыл бұрын
how did you change your codeforces cp handle from healthyUG to demoralizer??? i just wrote without thinking much at that time now i want to change it! how to do it can you tell me plz!
@abhishekkumar-vk8kc
@abhishekkumar-vk8kc 3 жыл бұрын
Sir please make video on dp and graphs from basic to advanced
@KunalLadhani
@KunalLadhani 3 жыл бұрын
How did you setup sublime for CP Can you tell pls.
@anupamdubey5736
@anupamdubey5736 3 жыл бұрын
Awesome class!
@pronoob5664
@pronoob5664 3 жыл бұрын
Thank you LORD DEMORALIZER
@sunnykumarsingh7039
@sunnykumarsingh7039 2 жыл бұрын
in the mod program, if b==0 we should return 1 or a%m?
@BRAJESHKUMAR-lz4mw
@BRAJESHKUMAR-lz4mw 3 жыл бұрын
Is it possible to right a number in form of 3^x + 7^y where x and y is any positive integer value. We need to return true or false. Can someone please provide a efficient solution for this question?
@realnight_bot2536
@realnight_bot2536 3 жыл бұрын
Are JOD sir 🤩
@notlinuxneverdies5846
@notlinuxneverdies5846 3 жыл бұрын
Thank you sooo much!!!
@vanquishersgaming138
@vanquishersgaming138 2 жыл бұрын
You're awesome 🙌
@chatrughanprasad7778
@chatrughanprasad7778 3 жыл бұрын
Great Lecture Bro!
@darshanmahankar6626
@darshanmahankar6626 3 жыл бұрын
The Speed at which complier is working and Set-up is made ....i am desparately waiting when that content would be Up on channel 🙂🤝💔
@ddnsdeepak8148
@ddnsdeepak8148 3 жыл бұрын
Bro please make a video on your sublime text setup of U .
@lakeshkumar1281
@lakeshkumar1281 3 жыл бұрын
simply awesome
@sakshamgulati5854
@sakshamgulati5854 2 жыл бұрын
Bhaiya other topics ki bhi detailed videos bana do please jo cp mei important hote hai..🙏
@crazyteam9370
@crazyteam9370 3 жыл бұрын
Hello brother ! Please make a video on how to setup Sublime text as you had in your laptop
@ascyrax8507
@ascyrax8507 3 жыл бұрын
24:06 what does "#define SIEVE" do? ps: very helpful video thanks.
@jeevanalexen
@jeevanalexen 3 жыл бұрын
it prints all the prime numbers till the given n
@ascyrax8507
@ascyrax8507 3 жыл бұрын
@@jeevanalexen I got that already. I just wanted to know what does this single statement do?
@utkarshgupta9858
@utkarshgupta9858 3 жыл бұрын
I have #ifdef SIEVE sieve() in my template... It just saves me 2 seconds and I don't have to write 1 extra line to call the sieve function...
@ascyrax8507
@ascyrax8507 3 жыл бұрын
@@utkarshgupta9858 got it thanks. what is ur next video gonna be :)?
@MdMaruf-ln9pv
@MdMaruf-ln9pv Жыл бұрын
sir can you please tell me from where you learned all this topics??
@Aditya-if3ij
@Aditya-if3ij 3 жыл бұрын
Purple is my aim for this year.
@sumeetubale3923
@sumeetubale3923 2 жыл бұрын
hi utkarsh bhaiyya ,at time 56 : 00 the code is giving wrong output for input a=156 b = 4 and m = 7 could you plz verify it where I can go wrong !! and thank you so much for this amazing video !! just loved it!! plz don't stop ever to make video related to cp
@utkarshgupta9858
@utkarshgupta9858 2 жыл бұрын
i made a small mistake in the code, if power is zero, we should return 1 instead of a.
@sumeetubale3923
@sumeetubale3923 2 жыл бұрын
@@utkarshgupta9858 ok thank you bhaiyya!!
@algotalk5368
@algotalk5368 3 жыл бұрын
Please update this slide
@ffera6611
@ffera6611 2 жыл бұрын
please add graph videos also like this one
@GeneralistDev
@GeneralistDev 3 жыл бұрын
Please share your sublime setup
@arsh2489
@arsh2489 Жыл бұрын
this changed my cp career ❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤😍😍😍😍😍😍😍😍😍😍
@rohitjangir8303
@rohitjangir8303 3 жыл бұрын
Hey brother can u make a video on how to setup sublime text like you for competitive programming
@035asadali8
@035asadali8 3 жыл бұрын
i thought i know very lesss but after seeing todays video i understand i know all topics he discuss today and even more he not add
@AjithKumaR-jw9wt
@AjithKumaR-jw9wt 3 жыл бұрын
Where u learn all this things
@035asadali8
@035asadali8 3 жыл бұрын
@@AjithKumaR-jw9wt few days ago and still learning , if u want to understand number theory try code n code number theory playlist
@AjithKumaR-jw9wt
@AjithKumaR-jw9wt 3 жыл бұрын
@@035asadali8 bro any prerequisite to learn number theory
@AjithKumaR-jw9wt
@AjithKumaR-jw9wt 3 жыл бұрын
@@035asadali8 what are the topics we want to cover in dsa before cp
@035asadali8
@035asadali8 3 жыл бұрын
@@AjithKumaR-jw9wt for number theory no prerequisite needed
@simranvedpathak7112
@simranvedpathak7112 3 жыл бұрын
🔥🔥
@thilakreddy1904
@thilakreddy1904 3 жыл бұрын
can u explain what is O(log)
@unaizsiddiqui3892
@unaizsiddiqui3892 3 жыл бұрын
Brother, i love to watching your video... But i have a problem, why you don't make a video in hindi... Hum bachee hai bhaiya hindii me explain karoo ge to...or ache se samj ayega...and channel bhi fast grow karega...(padhee ga india to badhega india)💫♥️
C++ STL: The ONLY Video You Need | Compulsory for DSA/CP
57:44
Utkarsh Gupta
Рет қаралды 185 М.
Nothing Can Stop you from Competitive Programming After This!!!
16:29
Priyansh Agarwal
Рет қаралды 78 М.
ССЫЛКА НА ИГРУ В КОММЕНТАХ #shorts
0:36
Паша Осадчий
Рет қаралды 8 МЛН
Their Boat Engine Fell Off
0:13
Newsflare
Рет қаралды 15 МЛН
One second to compute the largest Fibonacci number I can
25:55
Sheafification of G
Рет қаралды 473 М.
one year of studying (it was a mistake)
12:51
Jeffrey Codes
Рет қаралды 279 М.
Fast Inverse Square Root - A Quake III Algorithm
20:08
Nemean
Рет қаралды 5 МЛН
How I would learn Leetcode if I could start over
18:03
NeetCodeIO
Рет қаралды 822 М.
This is How Easy It Is to Lie With Statistics
18:55
Zach Star
Рет қаралды 6 МЛН