4 4 votes Algorithms programming recursion made-easy-test-series + – sumit chakraborty 1.3k views answer comment Share Follow Print See all 6 Comments 6 6 Comments reply Show 3 previous comments Tesla! commented Jan 28, 2018 reply Follow flag 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 0 replyShare sumit chakraborty commented Jan 28, 2018 reply Follow flag Given answer is 13. 0 0 replyShare sumit chakraborty commented Jan 28, 2018 reply Follow flag Also if you follow this : http://gateoverflow.in/8498/gate2015-3_39, you will get 13. 1 1 replyShare Please log in or register to add a comment.
0 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 0 reply Please log in or register to add a comment.