Re 4. Problems on Functional Recursion | Strivers A2Z DSA Course

  Рет қаралды 626,910

take U forward

take U forward

Күн бұрын

Пікірлер: 392
@sushantmittal6669
@sushantmittal6669 2 жыл бұрын
"if you don't know what reverse is, I can't help" savageee😂
@naveenabburi9099
@naveenabburi9099 Жыл бұрын
😂😂
@itzmartin20
@itzmartin20 Жыл бұрын
harsh but true :)
@asmittyagi6250
@asmittyagi6250 Жыл бұрын
😂😂
@webdesignersandip7469
@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
@Entertainmentexe Жыл бұрын
The greatest DSA playlist on the internet.❤
@onepiece07-hl4hj
@onepiece07-hl4hj Жыл бұрын
Lord striver.
@vamshipaidimarri983
@vamshipaidimarri983 3 жыл бұрын
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
@MdAyub-wl4hk Жыл бұрын
recursion was so hard for me but watching your videos i getting clear now
@husain7849
@husain7849 Жыл бұрын
Hey everyone welcome back to the channel. I hope you guys are doing EXTREMELY well
@adityakumar-sp4ki
@adityakumar-sp4ki 2 жыл бұрын
I have seen couple of videos but definitely your way of explanations is exceptional. Short & crisp and deep dive of concepts.
@rap_like_yash
@rap_like_yash 10 ай бұрын
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
@cherry6288
@cherry6288 5 ай бұрын
Just what i needed
@Manishgupta200
@Manishgupta200 2 жыл бұрын
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
@fine2981
@fine2981 2 жыл бұрын
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.
@Manishgupta200
@Manishgupta200 2 жыл бұрын
@@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
@GaganSingh-zz9el Жыл бұрын
@@Manishgupta200 one can see strivers video and sheet in one place
@ketanjagat3005
@ketanjagat3005 2 жыл бұрын
Brother your explanations are far more better than any paid course ❤❤❤❤❤❤Thankyou so much
@ishaanloomba3848
@ishaanloomba3848 2 жыл бұрын
You have worked a lot to make us understand these coding concepts. You deserve more subs💯
@santhikakani1627
@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
@husain7849 Жыл бұрын
Rip english
@umangrathod6737
@umangrathod6737 11 ай бұрын
@@husain7849
@smalleffortsgrow844
@smalleffortsgrow844 2 жыл бұрын
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
@nandeeshb4858
@nandeeshb4858 5 ай бұрын
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
@rehanhussan Жыл бұрын
the concept is Crystal Clear for me now, thank you for the series of videos
@adityakulshrestha7033
@adityakulshrestha7033 2 жыл бұрын
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
@kirtikhohal5025
@kirtikhohal5025 2 жыл бұрын
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
@kevinfrancis7819 Жыл бұрын
No you need to use i>=2 to work both for odd and even
@kevinfrancis7819
@kevinfrancis7819 Жыл бұрын
No you need to use i>=2 to work both for odd and even
@preethamreddy9610
@preethamreddy9610 2 ай бұрын
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!
@banny3337
@banny3337 2 күн бұрын
what is your progress brother!
@shubhamagarwal1434
@shubhamagarwal1434 6 ай бұрын
#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...
@anuradha3868
@anuradha3868 6 ай бұрын
Hey sir I'm a 4th year student as uh have 10 yrs of experience can uh plz guide me
@kirtikhohal5025
@kirtikhohal5025 2 жыл бұрын
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.
@SomeoneAlive90
@SomeoneAlive90 2 жыл бұрын
This is what I was thinking while I watched the video
@ctrl_alt_start9809
@ctrl_alt_start9809 2 жыл бұрын
ya you are correct but for beginners, it can create some sort of confusion .
@tharunkumar8507
@tharunkumar8507 2 жыл бұрын
Anything will be ok bcz both are comparisons
@kon_humein
@kon_humein Жыл бұрын
farq nhi prta jo chiz hogi nhi wo likhne se kya he hoga wasa bhi equal sign hai toh na😂
@abbadmus
@abbadmus Жыл бұрын
Thanks!
@monasoni4881
@monasoni4881 11 ай бұрын
One of the best DSA playlist on the internet.📚
@sivakandan4819
@sivakandan4819 Ай бұрын
the best among all
@shubha_jagadeesh
@shubha_jagadeesh 5 ай бұрын
Finally i got the perfect playlist for DSA Thank you 💌
@yaswanthkosuru
@yaswanthkosuru Жыл бұрын
honestly ,really you are great ,efforts you are putting are really great
@studynewthings1727
@studynewthings1727 Жыл бұрын
Thankyou Striver, I understood Problems on Functional Recursion.
@MahirSharma-r7k
@MahirSharma-r7k 9 ай бұрын
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-d7j
@kallabhargavi-d7j 10 ай бұрын
thank you striver the best playlist which i haven't watched before, thank you so much striver bro
@Musicuvakavi1823
@Musicuvakavi1823 9 ай бұрын
Recursion was hard because watching your video but now U make it easier Thanks a lot Striver Sir The Man behind my success
@adityabedi266
@adityabedi266 19 күн бұрын
14-01-2025 completed this topic learn a lot about parameter and functional recursion. Thanks sir 😊
@omgaikwad5962
@omgaikwad5962 2 жыл бұрын
Understood the concept of recursion! Thanks Striver.
@Ytpremium-e2p
@Ytpremium-e2p 10 ай бұрын
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
@muhammedimdaad Жыл бұрын
9:54 I think an array is passed as a pointer to the first block of memory of the array
@48_subhambanerjee22
@48_subhambanerjee22 Жыл бұрын
The best coding channel ever created
@deepasinha8526
@deepasinha8526 2 жыл бұрын
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.
@bikrammajhi7278
@bikrammajhi7278 7 ай бұрын
Sir, your way of explanations is crystal clear!
@merimarzi-wy8ck
@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); } }
@aamir4684
@aamir4684 4 ай бұрын
Thanks, bhaiya i am 2 nd year ee student only due to your precious effort i under stand the cocept of recurssion.
@swarupsaha9064
@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)); } }
@Thecarboy0
@Thecarboy0 4 ай бұрын
just started the series and loving it
@KK-hd4wy
@KK-hd4wy 27 күн бұрын
which yr bro?
@eshaalakshmids
@eshaalakshmids 7 ай бұрын
Thank you so much!! You explain so well, understood everything with clarity.
@ananyamunu
@ananyamunu Жыл бұрын
Your effort is highly appreciated😇
@yashgupta6726
@yashgupta6726 2 жыл бұрын
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
@AtanuDebnath Жыл бұрын
thank you raj bhai , understood !
@beproductive6171
@beproductive6171 3 жыл бұрын
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_ok
@its_neel_ok 2 жыл бұрын
for palindrom i did this-- bool check(string s1, string s, int n,int i){ if(n
@bestfriend9508
@bestfriend9508 Жыл бұрын
if you don't know what reverse is, I can't help
@tejas-hy4ch
@tejas-hy4ch 4 ай бұрын
Love you bro ❤ I'm watching at 2am
@learnergood
@learnergood 4 ай бұрын
@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?
@notshubhm
@notshubhm 2 жыл бұрын
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
@roshnibandhu5114
@roshnibandhu5114 2 жыл бұрын
thank u so much!!
@udaytewary3809
@udaytewary3809 2 жыл бұрын
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_ok
@its_neel_ok 2 жыл бұрын
i did the reverse the array like this -- void reverse(int a[], int i, int n){ if(i
@yashverma2986
@yashverma2986 2 жыл бұрын
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_ok
@its_neel_ok 2 жыл бұрын
@@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
@yashverma2986
@yashverma2986 2 жыл бұрын
@@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_ok
@its_neel_ok 2 жыл бұрын
@@yashverma2986 oooo ok thanks
@willsmith9112
@willsmith9112 3 жыл бұрын
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
@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
@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.
@singhdevesh
@singhdevesh 10 ай бұрын
*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
@samuelfrank1369 Жыл бұрын
Understood. Thanks a lot.
@nishitrokad5007
@nishitrokad5007 2 жыл бұрын
Bhai, very nice explanation. You made this concept very easy.
@ashishsahay1901
@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
@AtulKumar-c4x7l Жыл бұрын
understood Thank you striver for such an amazing explanation
@shubhamagarwal1434
@shubhamagarwal1434 Жыл бұрын
Very nice explanation...God Bless You
@sairammv8802
@sairammv8802 7 ай бұрын
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 ?
@yuvrajprasad3844
@yuvrajprasad3844 7 ай бұрын
I too have this doubt.
@nn824
@nn824 8 ай бұрын
Hi, this is just a notification i want to put: the website is not reachable if you put WWW......
@sharannarsingi7578
@sharannarsingi7578 10 ай бұрын
java function code : public static boolean pro7(String r,int i) { if(i >= r.length()/2) return true; if(r.charAt(i) != r.charAt(r.length()-i-1)) return false; return pro7(r,i+1); }
@snowy-ur9qq
@snowy-ur9qq 6 ай бұрын
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?
@rumiNITPatna
@rumiNITPatna 6 ай бұрын
thank u so much striver for this wonderful video.
@webdesignersandip7469
@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
@kartiktodi
@kartiktodi 3 жыл бұрын
Does this series also include backtracking?
@nidhishprasad2506
@nidhishprasad2506 3 жыл бұрын
yes
@diwakarkumar3919
@diwakarkumar3919 Жыл бұрын
understood bro thank you for like this gem.😊
@vilen2685
@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
@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); } };
@chesscraze7794
@chesscraze7794 8 күн бұрын
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
@yuvrajluhach5665
@yuvrajluhach5665 3 жыл бұрын
Moving to L5 love this series
@RituSingh-ne1mk
@RituSingh-ne1mk Жыл бұрын
Understood!
@jaivardhan1016
@jaivardhan1016 2 жыл бұрын
This is god level content!!!
@stith_pragya
@stith_pragya 2 жыл бұрын
Thanks Striver Brother 🙏🙏🙏
@iamnottech8918
@iamnottech8918 11 ай бұрын
but if we are still passing two param in function call then what is the use of that approach
@supernova4467
@supernova4467 Жыл бұрын
reverse a array : void f(int a[],int n){ if(n==0) return; cout
@RahulVyas-wt5yk
@RahulVyas-wt5yk 7 ай бұрын
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_guy5347
@nice_random_guy5347 21 күн бұрын
Understood thanks ❤
@worthlessguy1621
@worthlessguy1621 9 ай бұрын
understood sir thanks for an awesome video again
@Mythri333
@Mythri333 Жыл бұрын
Thank you 😊😊
@harsh.m2897
@harsh.m2897 6 күн бұрын
are these Parameterized Recursion ??
@viggicodes
@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
@adityaasthana8758 Жыл бұрын
why you taken "s" as refrence?? I don't understand....pls explain
@kidoo1567
@kidoo1567 8 ай бұрын
Swap 2 num using 2 pointer and 1 pointer, check string is palendrime
@UECAshutoshKumar
@UECAshutoshKumar 2 жыл бұрын
Thank you PARAMATIC METHORD #include using namespace ::std; void palindrome(string st, int n, int i) { if (i >= n / 2) { cout
@Abhishek_raj27
@Abhishek_raj27 5 ай бұрын
well explained .thank you!
@NazeerBashaShaik
@NazeerBashaShaik 8 ай бұрын
Understood, thank you.
@amarjeetkumar-hk2jl
@amarjeetkumar-hk2jl 2 жыл бұрын
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....
@GhostRider.... 2 жыл бұрын
if(i> n/2) or if(i> =n/2) does this create any differernce in result or both are same?
@sujathaiyer3166
@sujathaiyer3166 2 жыл бұрын
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
@ravalikatalks5285 Жыл бұрын
thank you bhaiya
@sanjuadhikary4652
@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
@shashankchaturvedi7876 Жыл бұрын
Narsimha Karumanchi
@FaheemKhan-lt5fe
@FaheemKhan-lt5fe Жыл бұрын
8:31 how is 2>=2.5 true here ?
@DevajSanghvi-wf6bt
@DevajSanghvi-wf6bt 11 ай бұрын
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
@harshalparanjiya5850 Ай бұрын
let's go ---> 13 december 🔥
@Raj_0028
@Raj_0028 3 жыл бұрын
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?
@saptathirtachoudhury4158
@saptathirtachoudhury4158 2 жыл бұрын
I don't think time complexity would count for deallocating Auxilary space
@anmolchokhani6362
@anmolchokhani6362 2 жыл бұрын
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).
@muthupandideivamsanmugam1774
@muthupandideivamsanmugam1774 2 жыл бұрын
O(n) + O(n) = 2O(n) = O(n) :)
@crazymemes4080
@crazymemes4080 3 жыл бұрын
wow themks bhayam 😎🔥 subha subha mazza aagaya
@Yataliblogy
@Yataliblogy Жыл бұрын
but this code palindrome didnt work for cp , we have to use the #include for cp
@changed217
@changed217 Жыл бұрын
Completely understood, thanks.
@fanboiishorts
@fanboiishorts 2 жыл бұрын
No One Can match you in this industry
@janardhan2jordan
@janardhan2jordan Жыл бұрын
0:44 if you dont know what reverse is i cant help😂😂🤣
@utsavseth6573
@utsavseth6573 Жыл бұрын
concise and clear.
@dipeshburnwal2267
@dipeshburnwal2267 2 жыл бұрын
// 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; } }
@notshubhm
@notshubhm 2 жыл бұрын
Thanks bro
@akashkumawat-xk1eg
@akashkumawat-xk1eg 26 күн бұрын
thank you so much
Re 5. Multiple Recursion Calls | Problems | Strivers A2Z DSA Course
16:45
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 53 МЛН
Что-что Мурсдей говорит? 💭 #симбочка #симба #мурсдей
00:19
小丑教训坏蛋 #小丑 #天使 #shorts
00:49
好人小丑
Рет қаралды 54 МЛН
I Found The HARDEST LeetCode Question (79% FAILURE RATE)
17:59
A Life Engineered
Рет қаралды 8 М.
L6. Recursion on Subsequences | Printing Subsequences
25:01
take U forward
Рет қаралды 689 М.
AI Is Making You An Illiterate Programmer
27:22
ThePrimeTime
Рет қаралды 261 М.
Object-Oriented Programming is Bad
44:35
Brian Will
Рет қаралды 2,4 МЛН
Re 3. Parameterised and Functional Recursion | Strivers A2Z DSA Course
18:14
Jonathan Blow on Refactoring
7:10
Anton Swifton
Рет қаралды 143 М.
Factorio teaches you software engineering, seriously.
21:27
Tony Zhu
Рет қаралды 2 МЛН
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 53 МЛН