Unformatted text preview:

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

GSU CSC 2320 - Quiz5 CSCI2320

Download Quiz5 CSCI2320
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Quiz5 CSCI2320 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Quiz5 CSCI2320 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?