CSCI 2320 Data Structure Quiz5Question 1 (60 pts)Consider the following recursive code:int Func ( int a, int b ){ int result; if ( b <= 10 ) result = 5; return b;else result = a + Func ( a + 5 , b - 5 ) ) ; return result+10; } Please fill in the runtime stack for Func(10, 25) Return10Result5a25b 10Return? 40Resulta+F(25,10) 30a20 20b 15 15Return? 65Resulta+F(20,15) 55a15 15b 20 20Return? 85Resulta+F(15,20) 75a10 10b 25 25Question 2 (40 pts)Consider the give tree structure:2.1 What is the output of the following function:Void PrintPreorder (root) { if root != null print(root->data); PrintPreorder(root->left); PrintPreorder(root->right); print(root->data); endif; } 1 2 4 4 5 7 7 5 2 3 6 6 3 1 2.2 What is the output of the following function:Void PrintPreorder (root) { if root != null print(root->data); PrintPreorder(root->left); PrintPreorder(root->right); PrintPreorder(root->right); endif; } 1 2 4 5 7 5 7 3 6 6 3 6
View Full Document