4 votes 4 votes Algorithms programming recursion made-easy-test-series + – sumit chakraborty asked Jan 28, 2018 • edited Mar 4, 2019 by ajaysoni1924 sumit chakraborty 670 views answer comment Share Follow See all 6 Comments See all 6 6 Comments reply Show 3 previous comments Tesla! commented Jan 28, 2018 reply Follow Share Correction actually If(x<=1){++x: return;} is not required because this statement is not calling rec() function so whats point of counting and also answer will be 13 0 votes 0 votes sumit chakraborty commented Jan 28, 2018 reply Follow Share Given answer is 13. 0 votes 0 votes sumit chakraborty commented Jan 28, 2018 reply Follow Share Also if you follow this : http://gateoverflow.in/8498/gate2015-3_39, you will get 13. 1 votes 1 votes Please log in or register to add a comment.
0 votes 0 votes rec(7) -> rec(5), rec(4) rec(5)-> rec(3), rec(2) rec(3)-> rec(1), rec(0) rec(2)-> rec(0), rec(-1) rec(4)->rec(2), rec(1) rec(2)->rec(0), rec(-1) This will be flow top down left to right flow Tesla! answered Jan 28, 2018 Tesla! comment Share Follow See all 0 reply Please log in or register to add a comment.