If i have a list and i want to change the list order using the recursion. How can i do that? Is there any simple way or best way to do that?
Here is something that i have think about, how it works:
list = [0,1,2,3,4,5,6,7,8,9];
if if(list.length<1){
return list;
}else{
//making list last to first.
}
should return this:
[9,8,7,6,5,4,3,2,1,0]
I'm quite new with this recursion, if someone could explain a little bit, how it works. Thanks