Unformatted text preview:

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

GSU CSC 2320 - Quiz5 key

Download Quiz5 key
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 key 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 key 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?