2 votes 2 votes To remove recursion from a program we have to use which of the following data structure? array stack queue list DS data-structures recursion stack + – eyeamgj asked Jun 18, 2018 edited Jun 18, 2018 by Subarna Das eyeamgj 2.2k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
3 votes 3 votes ans-Stack for the recursion calls stack is used .If we execute a function which is calling itself again and again then with the help of stack recursion can be removed. Anil Ji answered Jun 18, 2018 Anil Ji comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes i think it is array.because array fixed size,can't change it's size. Shijith M answered Jun 18, 2018 reshown Jun 18, 2018 by Shijith M Shijith M comment Share Follow See all 4 Comments See all 4 4 Comments reply eyeamgj commented Jun 18, 2018 reply Follow Share but answe given is stack dont know why ,any strong reference to ur answer?? 0 votes 0 votes Shijith M commented Jun 18, 2018 reply Follow Share yes it is stack.in the previous time i not focus the word "from a program".that means there already exists a recursion.we use stack for call recursion. This recursion we can cancel by using reverse the same recursion. that is .....consider the function rec_factorial(5) 5->4->3->2->1(1*2*3*4*5) then we can remove the same recursion by using another stack 1->2->3->4->5 sorry for the previous wrong answer. 1 votes 1 votes eyeamgj commented Jun 18, 2018 reply Follow Share what is "removing recursion " actuallly means?? 0 votes 0 votes Shijith M commented Jun 18, 2018 reply Follow Share Here removing recursion, meant that just cancel the effect of recursion from program.We can cancel recursion effect by using another stack.but program of that stack should be reverse of already existing recursion program.....just like X-Y here we can remove effect of -Y using +Y....(actually we cancel effect of -Y instead of remove -Y) 0 votes 0 votes Please log in or register to add a comment.