Home /
Expert Answers /
Computer Science /
a-compare-recursion-and-iteration-approach-in-programming-4-marks-b-the-following-figure-sho-pa220
(Solved): (a) Compare recursion and iteration approach in programming. (4 marks) (b) The following figure sho ...
(a) Compare recursion and iteration approach in programming. (4 marks) (b) The following figure show as a node structure for class Li stNode of a singly linked list, while method evenLoop ( ) is used to print all node with even key values in reverse order using iteration structure. public void eventoop () ListNode temp = head; for (int i= size-1; >>0;i??){ for (j=0;j<i;j++) temp = temp. next; if (temp.key o 2==0 ) System.out.println (temp.key) \} public void evenLoop () 1 ListNode temp = head; for (int i= size-1; i>=0;i?? ) \{ for (j=0;j<i;j++) temp = temp . next; if (temp.key o 2==0 ) system.out.println (temp. key) \} \} Convert the following program to display the same out, using recursion.