"if you don't know what reverse is, I can't help" savageee😂
@naveenabburi9099 Жыл бұрын
😂😂
@itzmartin20 Жыл бұрын
harsh but true :)
@asmittyagi6250 Жыл бұрын
😂😂
@webdesignersandip7469 Жыл бұрын
@sushantmittal6669 mandela effect happened again watch again he said "if you don't understand what is reverse, I can't help" previously he said "if you don't know what reverse is, I can't help" the way he said it has also changed
@Entertainmentexe Жыл бұрын
The greatest DSA playlist on the internet.❤
@onepiece07-hl4hj Жыл бұрын
Lord striver.
@vamshipaidimarri9833 жыл бұрын
I was always surprised and felt hard to understand the logics written in 2 to 3 lines but the way you have explained is giving me confidence to write more and more simple functions for solving huge problems too. I never continued any programming lectures more than 2 or so at a time but it is really giving me interest to finish off the series and practise a lot and go on with other series too. Thank You !!!
@MdAyub-wl4hk Жыл бұрын
recursion was so hard for me but watching your videos i getting clear now
@husain7849 Жыл бұрын
Hey everyone welcome back to the channel. I hope you guys are doing EXTREMELY well
@adityakumar-sp4ki2 жыл бұрын
I have seen couple of videos but definitely your way of explanations is exceptional. Short & crisp and deep dive of concepts.
@rap_like_yash10 ай бұрын
00:01 Learning how to reverse an array and check if a string is a palindrome using recursion 02:12 Understanding the recursion for swapping arrays 04:26 Understanding functional recursion and single pointer approach 06:48 Functional recursion demonstrated with swapping array elements 09:12 Functional recursion allows for carrying extra parameters for complex tasks. 11:16 A palindrome is a string that reads the same on reversal. 13:34 Using functional recursion to check for palindromic strings 15:56 Demonstrating functional recursion in checking for palindrome strings. 17:59 Explanation of time and space complexity of the functional recursive function
@cherry62885 ай бұрын
Just what i needed
@Manishgupta2002 жыл бұрын
Thankyou Striver.. Through your video tutorial I'm now improving my thinking ability to solve prolems like Check the Palindrome and reverse array problem and all other question in another another way. This is my step 2 improvement to in the coding journey
@fine29812 жыл бұрын
from where did you learn recursion? I am facing problem in it , although I have done all the basic questions of recursion but not able to solve medium problems.
@Manishgupta2002 жыл бұрын
@@fine2981 first of all read some documentation on recursion then see the Striver recursion playlist & try to solve Q.s totally by yourself by pen & paper method with recursion tree. It would help a lot. And one more tip I prefer you to follow the Strider DSA sheet + Love Babber 149 video series simultaneously.
@GaganSingh-zz9el Жыл бұрын
@@Manishgupta200 one can see strivers video and sheet in one place
@ketanjagat30052 жыл бұрын
Brother your explanations are far more better than any paid course ❤❤❤❤❤❤Thankyou so much
@ishaanloomba38482 жыл бұрын
You have worked a lot to make us understand these coding concepts. You deserve more subs💯
@santhikakani1627 Жыл бұрын
I was not able to understand how to do recursion but now after your explanation I can be able to do recursion. Thank you very much.
@husain7849 Жыл бұрын
Rip english
@umangrathod673711 ай бұрын
@@husain7849
@smalleffortsgrow8442 жыл бұрын
This guy is legend the way he teaches excellent.Can u make all dsa series it will be help for the youth of india or the whole world
@nandeeshb48585 ай бұрын
00:01 Learning how to reverse an array and check if a string is a palindrome using recursion 02:12 Understanding the recursion for swapping arrays 04:26 Understanding functional recursion and single pointer approach 06:48 Functional recursion demonstrated with swapping array elements 09:12 Functional recursion allows for carrying extra parameters for complex tasks. 11:16 A palindrome is a string that reads the same on reversal. 13:34 Using functional recursion to check for palindromic strings 15:56 Demonstrating functional recursion in checking for palindrome strings. 17:59 Explanation of time and space complexity of the functional recursive function Crafted by Merlin AI.
@rehanhussan Жыл бұрын
the concept is Crystal Clear for me now, thank you for the series of videos
@adityakulshrestha70332 жыл бұрын
i think if the size will be even then the if condition will be if(i>n/2) it works on both even and odd
@kirtikhohal50252 жыл бұрын
No, the condition if(i==n/2) works on both even and odd, like if the size of the string or array is 5 , then 5/2=2, it will stop, as there is no need to compare or swap this middle element. in case of n=6, swapping or comparing till index=2 works fine (as we have have compared or swapped 3 elements of the array ), when i becomes 3 it will stop. The greater than symbol in the base condition is not at all required in the either of the last two questions.
@kevinfrancis7819 Жыл бұрын
No you need to use i>=2 to work both for odd and even
@kevinfrancis7819 Жыл бұрын
No you need to use i>=2 to work both for odd and even
@preethamreddy96102 ай бұрын
Understood. Today is November 29th, 2024 and i have just completed watching this video. I will come here periodically to update my status and my offers! Wish me luck!
@banny33372 күн бұрын
what is your progress brother!
@shubhamagarwal14346 ай бұрын
#Free Education For All... # Bhishma Pitamah of DSA...You could have earned in lacs by putting it as paid couses on udamey or any other elaerning portals, but you decided to make it free...it requires a greate sacrifice and a feeling of giving back to community, there might be very few peope in world who does this..."विद्या का दान ही सर्वोत्तम दान होता है" Hats Off to you man, Salute from 10+ yrs exp guy from BLR, India...
@anuradha38686 ай бұрын
Hey sir I'm a 4th year student as uh have 10 yrs of experience can uh plz guide me
@kirtikhohal50252 жыл бұрын
The greater than symbol in the base conditions of last two questions is not at all required , just checking if(i==n/2) will be good to go.
@SomeoneAlive902 жыл бұрын
This is what I was thinking while I watched the video
@ctrl_alt_start98092 жыл бұрын
ya you are correct but for beginners, it can create some sort of confusion .
@tharunkumar85072 жыл бұрын
Anything will be ok bcz both are comparisons
@kon_humein Жыл бұрын
farq nhi prta jo chiz hogi nhi wo likhne se kya he hoga wasa bhi equal sign hai toh na😂
@abbadmus Жыл бұрын
Thanks!
@monasoni488111 ай бұрын
One of the best DSA playlist on the internet.📚
@sivakandan4819Ай бұрын
the best among all
@shubha_jagadeesh5 ай бұрын
Finally i got the perfect playlist for DSA Thank you 💌
@yaswanthkosuru Жыл бұрын
honestly ,really you are great ,efforts you are putting are really great
@studynewthings1727 Жыл бұрын
Thankyou Striver, I understood Problems on Functional Recursion.
@MahirSharma-r7k9 ай бұрын
we can equate the time complexity of O(N/2) to O(N), following the principle you discussed in the space and time complexity video (this is because (N * 1/2) simplifies to N, and since 1/2 is a constant, we can disregard it.)
@kallabhargavi-d7j10 ай бұрын
thank you striver the best playlist which i haven't watched before, thank you so much striver bro
@Musicuvakavi18239 ай бұрын
Recursion was hard because watching your video but now U make it easier Thanks a lot Striver Sir The Man behind my success
@adityabedi26619 күн бұрын
14-01-2025 completed this topic learn a lot about parameter and functional recursion. Thanks sir 😊
@omgaikwad59622 жыл бұрын
Understood the concept of recursion! Thanks Striver.
@Ytpremium-e2p10 ай бұрын
thank you so much for this dsa series, i hope i will be consistent for this series and i have a confidence of cracking google. Thanks again
@muhammedimdaad Жыл бұрын
9:54 I think an array is passed as a pointer to the first block of memory of the array
@48_subhambanerjee22 Жыл бұрын
The best coding channel ever created
@deepasinha85262 жыл бұрын
I am really understanding the concept now. Till now, it was something very complex for me , no matter how much I do read/practice. Thank you for this series. Really appreciate your effort and dedication.
@bikrammajhi72787 ай бұрын
Sir, your way of explanations is crystal clear!
@merimarzi-wy8ck Жыл бұрын
Reversing the array Using two Variable import java.util.Arrays; public class ReverseArray { public static void main(String[] args) { int[] arr ={5,4,3,2,1}; int right=arr.length-1; int left = 0; rvrse(arr,left,right); System.out.println(Arrays.toString(arr)); } static void rvrse(int[] arr , int left , int right){ if(rightn/2){ return; } int temp = arr[i]; arr[i]=arr[n-i-1]; arr[n-i-1]=temp; rvrsee(arr,i+1); } }
@aamir46844 ай бұрын
Thanks, bhaiya i am 2 nd year ee student only due to your precious effort i under stand the cocept of recurssion.
@swarupsaha9064 Жыл бұрын
JAVA based solution based on STRIVER's approach - Reverse of an array using Functional Recursion import java.util.Arrays; public class Main { static void reverseArray(int i, int[] test){ if(i >= test.length/2){ return; } //Swapping of elements int temp = test[i]; test[i] = test[test.length - i - 1]; test[test.length - i - 1] = temp; //Calling Recursively reverseArray(i + 1,test); } public static void main(String[] args) { int[] test = {1,2,3,4,5}; reverseArray(0,test); System.out.println(Arrays.toString(test)); } } - Check a string is Pallindrome using Functional recursion. public class Main { static boolean checkPalindrome(int i, String str){ int n = str.length(); if(i >= n/2){ return true; } if(str.toLowerCase().charAt(i) != str.toLowerCase().charAt(n - i - 1)){ return false; } return checkPalindrome(i+1,str); } public static void main(String[] args) { String str = "Madam"; System.out.println(checkPalindrome(0,str)); } }
@Thecarboy04 ай бұрын
just started the series and loving it
@KK-hd4wy27 күн бұрын
which yr bro?
@eshaalakshmids7 ай бұрын
Thank you so much!! You explain so well, understood everything with clarity.
@ananyamunu Жыл бұрын
Your effort is highly appreciated😇
@yashgupta67262 жыл бұрын
really good series, everyone is jumping on backtracking and complex recursive problem but it is really important to do the basic problems 1st to clear the concept. GREAT WORK!!!
@AtanuDebnath Жыл бұрын
thank you raj bhai , understood !
@beproductive61713 жыл бұрын
till now no one had taught recursion so well except Sriver bhaiya, He has done amazing work and cleared all my doubt. I m enjoying this videos, I will definitely watch the whole playlist.
@its_neel_ok2 жыл бұрын
for palindrom i did this-- bool check(string s1, string s, int n,int i){ if(n
@bestfriend9508 Жыл бұрын
if you don't know what reverse is, I can't help
@tejas-hy4ch4 ай бұрын
Love you bro ❤ I'm watching at 2am
@learnergood4 ай бұрын
@takeUforward I have doubt, is the problem explained functional recursion? As we are passing other parameters along with the the state of array it should be parameterised recursion right?
@notshubhm2 жыл бұрын
2:43 Code in Java package com.shubham; import java.util.Arrays; public class ProblemsOnFunctionalRecursion { static int[] swap(int[] arr, int left, int right){ if (left
@roshnibandhu51142 жыл бұрын
thank u so much!!
@udaytewary38092 жыл бұрын
Really thank-you bhaiya for your beautiful explanation Just for helping others if anybody is curious and doesn't know why bhaiya put the base condition as i>=n/2 because if it is only n then there will be reverse of array again and that will make the it like original array
@its_neel_ok2 жыл бұрын
i did the reverse the array like this -- void reverse(int a[], int i, int n){ if(i
@yashverma29862 жыл бұрын
bro you are not reversing array you are just printing the array reverse. if you pass this array to different function then it will take array same as before reversing.
@its_neel_ok2 жыл бұрын
@@yashverma2986 yes but isin't that the same 🤔, i was thinking that if we can just print the array in reverse, why we have to use a function to reverse it
@yashverma29862 жыл бұрын
@@its_neel_ok bro there is difference between printing and changing the place of the elements in the array. For example some function uses the same array with elements like 1,2,3 and some function uses for 3,2,1.
@its_neel_ok2 жыл бұрын
@@yashverma2986 oooo ok thanks
@willsmith91123 жыл бұрын
In my time when I am watching, I am watching how to check a string palindrome or not using recursion and the miracle is the like count on this master piece class on youtube is 797 which is also palindrome.
@barnam_das Жыл бұрын
17:55 Can someone please explain it quick why An ampersand (&) symbol was? ( i know it basic that "&" means address of and "*"means value of. i have watched the video also on Pass by value and pass by reference of Striver bhaiya)
@asmittyagi6250 Жыл бұрын
It will also work if we pass it by value because we don't want to change the actual value in the memory, we just want to check it and return True or False. It is a reminder that, unlike arrays, strings don't get passed by reference. If we use pass-by-reference, then that means whatever change we will do on it in the function will affect the actual value in the memory ......... hope this will clear your doubt, for any further doubt you can ask.
@singhdevesh10 ай бұрын
*Reverse of an Array* I write in this manner, is this good approach ? vector reverseArray(int n, vector &nums) { if (n==0) return {} ; cout
@samuelfrank1369 Жыл бұрын
Understood. Thanks a lot.
@nishitrokad50072 жыл бұрын
Bhai, very nice explanation. You made this concept very easy.
@ashishsahay1901 Жыл бұрын
Implementation Using JAVA Code -- int arr[] = {31,41,59,41,66}; int n = arr.length; int i = 0, j = n-1; reverse(arr,i,n); for (int l=0;l
@AtulKumar-c4x7l Жыл бұрын
understood Thank you striver for such an amazing explanation
@shubhamagarwal1434 Жыл бұрын
Very nice explanation...God Bless You
@sairammv88027 ай бұрын
explanation about the code is awesome but here one doubt in both problems not at all depending on the return types in that case both problems comes under parameterized recursion but not functional recursion right @takeUforward ?
@yuvrajprasad38447 ай бұрын
I too have this doubt.
@nn8248 ай бұрын
Hi, this is just a notification i want to put: the website is not reachable if you put WWW......
Thank you SO much for explaining these concepts. I always found recursion confusing but your videos are a great resource and I am getting a better understanding. SO, A BIG THANK YOU! I am still a little confused about the distinction between parameterized and functional recursion. After watching the previous video, I thought I got it but after watching this video, I am unsure. Since we were passing additional parameters eg. index to the recursive function, I thought it is parameterized recursion but the video says it's functional. Could you clarify?
@rumiNITPatna6 ай бұрын
thank u so much striver for this wonderful video.
@webdesignersandip7469 Жыл бұрын
mandela effect happened again watch again he said "if you don't understand what is reverse, I can't help" previously he said "if you don't know what reverse is, I can't help" the way he said it has also changed
@kartiktodi3 жыл бұрын
Does this series also include backtracking?
@nidhishprasad25063 жыл бұрын
yes
@diwakarkumar3919 Жыл бұрын
understood bro thank you for like this gem.😊
@vilen2685 Жыл бұрын
Palindrome String Topic-- In leetcode testcases pass - 479/485 what mistake i do please tell me. class Solution { int i = 0; public boolean isPalindrome(String s) { s= s.toLowerCase(); s=s.replaceAll("[^a-zA-Z0-9]", ""); if(i>=s.length()/2) return true; if(s.charAt(i)!=s.charAt(s.length()-i-1)) return false; i++; return isPalindrome(s); } }
@SubhradipBarik Жыл бұрын
class Solution { public: void reverse(vector &s,int l,int r) { if(l>r) { return; } swap(s[l],s[r]); reverse(s,l+1,r-1); } void reverseString(vector& s) { int n = s.size(); int l = 0; int r = n - 1; reverse(s,l,r); } };
@chesscraze77948 күн бұрын
as much as i remember there is no swap function in java... its available in c++.... so we gonna take extra variable to swap it.... otherwise we can import java.collections
@yuvrajluhach56653 жыл бұрын
Moving to L5 love this series
@RituSingh-ne1mk Жыл бұрын
Understood!
@jaivardhan10162 жыл бұрын
This is god level content!!!
@stith_pragya2 жыл бұрын
Thanks Striver Brother 🙏🙏🙏
@iamnottech891811 ай бұрын
but if we are still passing two param in function call then what is the use of that approach
In java: String s = "Madam"; boolean stringReverseCheck = reverseCheck(0,s); System.out.println("String Reverse Check :"+stringReverseCheck); } private static boolean reverseCheck(int i, String s) { s=s.toLowerCase(); if (i >= s.length()/2) { return true; } if (s.charAt(i) != s.charAt(s.length()-i-1)) { return false; } return reverseCheck(i+1, s); }
@nice_random_guy534721 күн бұрын
Understood thanks ❤
@worthlessguy16219 ай бұрын
understood sir thanks for an awesome video again
@Mythri333 Жыл бұрын
Thank you 😊😊
@harsh.m28976 күн бұрын
are these Parameterized Recursion ??
@viggicodes Жыл бұрын
def solve(s): # base case if len(s) == 1: return True if len(s)== 2 : return s[0] == s[1] f = s[0] l = s[-1] # hypothesis and induction return solve(s[1:-1]) and f == l
@adityaasthana8758 Жыл бұрын
why you taken "s" as refrence?? I don't understand....pls explain
@kidoo15678 ай бұрын
Swap 2 num using 2 pointer and 1 pointer, check string is palendrime
@UECAshutoshKumar2 жыл бұрын
Thank you PARAMATIC METHORD #include using namespace ::std; void palindrome(string st, int n, int i) { if (i >= n / 2) { cout
@Abhishek_raj275 ай бұрын
well explained .thank you!
@NazeerBashaShaik8 ай бұрын
Understood, thank you.
@amarjeetkumar-hk2jl2 жыл бұрын
Guys! here is java code for palindrome problem public class Main{ static boolean palindrome(int i, int n, String str){ if(i> n/2){ return true; } if(str.charAt(i)!= str.charAt(n)){ return false; } return palindrome(i+1, n-1, str); } public static void main(String[] args) { String str= "madam"; int n= str.length()-1; System.out.println(palindrome(0, n, str)); } }
@GhostRider....2 жыл бұрын
if(i> n/2) or if(i> =n/2) does this create any differernce in result or both are same?
@sujathaiyer31662 жыл бұрын
why have you used & symbol near string at the time of function definition i.e bool f(int i,string &s)this one.kindly reply
@ravalikatalks5285 Жыл бұрын
thank you bhaiya
@sanjuadhikary4652 Жыл бұрын
Hi Striver, Can you please let me know if I want to study a DSA book alongside your videos and notes, which book would you suggest me! I have recently started learning DSA from your videos and enjoying it.
@shashankchaturvedi7876 Жыл бұрын
Narsimha Karumanchi
@FaheemKhan-lt5fe Жыл бұрын
8:31 how is 2>=2.5 true here ?
@DevajSanghvi-wf6bt11 ай бұрын
5/2 is not 2.5 here It is just 2 Only the integer portion is considered So 2>=2 is true Hope you understand
@harshalparanjiya5850Ай бұрын
let's go ---> 13 december 🔥
@Raj_00283 жыл бұрын
I have a doubt regarding time complexity in recursion is that: we r using Auxilary space in terms of the stack, so my question is that let's suppose the program takes O(n) time to reach the base condition so after that stack space will reduce by going to the previous function so, it will also take O(n) time to empty the Auxilary stack space, so we can say time to be an Auxilary time so, Total time complexity would be O(n) + O(n). {time is taken to fill the Aux. stack + time is taken to empty the Aux. stack }. so I just want to know what I think does it make any sense or not. if not then why?
@saptathirtachoudhury41582 жыл бұрын
I don't think time complexity would count for deallocating Auxilary space
@anmolchokhani63622 жыл бұрын
time complexity only cares about the time taken to run the program. uske baad usko kuch lena dena nhi hai. and in recursion till the time the first function is not poped out the program isn't finished so it is automatically taken into account. anyways even if the auxiliary time you are considering the total time complexity will still be O(n) because O(n) + O(n)= O(n).
@muthupandideivamsanmugam17742 жыл бұрын
O(n) + O(n) = 2O(n) = O(n) :)
@crazymemes40803 жыл бұрын
wow themks bhayam 😎🔥 subha subha mazza aagaya
@Yataliblogy Жыл бұрын
but this code palindrome didnt work for cp , we have to use the #include for cp
@changed217 Жыл бұрын
Completely understood, thanks.
@fanboiishorts2 жыл бұрын
No One Can match you in this industry
@janardhan2jordan Жыл бұрын
0:44 if you dont know what reverse is i cant help😂😂🤣
@utsavseth6573 Жыл бұрын
concise and clear.
@dipeshburnwal22672 жыл бұрын
// reverse array using recursion type1:- in java public class Main { public static void main(String[] args) { int[] arr={0,1,2,3,4,5,6,7,8,9}; int length=arr.length; int[] revArray=reverseArray(arr,0,length-1); for(int i:revArray){ System.out.print(i+" "); } } public static int[] reverseArray(int[] a,int i,int j){ if(i=end){ return ; } swap(arr,start,end); skip(arr,start+1,end-1); } private static void swap(int[] arr ,int start, int end) { int temp = arr[start]; arr[start] = arr[end]; arr[end] = temp; } }