CSCI 2320 Data StructureQuiz 5 Apr/13/2009Name:__________________Question 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)Question 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); print(root->data); PrintPreorder(root->left); PrintPreorder(root->right); endif; } 1 1 2 2 4 4 5 5 3 3 6 6 7 7 2.2 What is the output of the following function:Void PrintPreorder (root) { if root != null print(root->data); PrintPreorder(root->right); print(root->data); PrintPreorder(root->right); endif; } 1 3 6 6 3 6 6 1 3 6 6 3 6
View Full Document