Program To Reverse A String Using Recursion | FREE DSA Course in JAVA | Lecture 34

preview_player
Показать описание

We are up with the lecture 34 of our much awaited dsa course in java.

Recursion is the topic we are covering in the da course these days.

We have seen a lot of examples of recursion through questions like Fibonacci series, count the number of digital in a number and sum of digits of a number.

Let's understand recursion with another important question from the interview point of view ie. reversing a string.

So we have to write a program to reverse a string using recursion.

As you all know we will first check whether the program satisfy the basic requirements of recursion.

And then we will se the logic behind the program.

Subscribe to our channel for regular updates on the dsa course and click on the bell icon to never miss an update from our dsa course.

or call us at 8884881203

#dsa #dsacourse #java #dsainjava #javaprogramming #coding #coder #bitmanipulation
Рекомендации по теме
Комментарии
Автор

sir u are amazing beautifully explained

Asherox
Автор

Please solve many more questions, bhaiya

hrithikrudra
Автор

def reversestring(s):
if s==“”:
return “”
return s[-1]+s[:len(s)-1]


in python it is the best solution

irshadirshu
Автор

public static String recursion(String string) {
if (string.length() == 1) {
return string;
}
return string.charAt(string.length() - 1) + recursion(string.substring(0, string.length() - 1));
}

amitjain