CS1050605b - Computer Science Foundation Exam May 6, 2005...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Computer Science Foundation Exam May 6, 2005 Computer Science Section 1B No Calculators! Name: SSN: Score: 50 In this section of the exam, there are four (4) problems. You must do all of them. The weight of each problem in this section is indicated with the problem. Partial credit cannot be given unless all work is shown and is readable. Be complete, yet concise, and above all be neat . KEY
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 1. [15 points] Given the binary tree shown below, answer questions (a) and (b). (a – 3 points) Is the binary tree shown above a valid binary search tree? YES NO Circle the correct answer. (b – 12 points) Determine the order in which the nodes of the binary tree shown above are visited assuming the function A(root) is invoked. Assume that the tree nodes and pointers are defined as shown. Assume that root is a pointer to the node containing 60. struct treeNode{ int data; struct treeNode *left, *right: } struct treeNode *tree_ptr; void A(struct tree_ptr *node_ptr){ if (node_ptr != NULL){ printf(“%d ,”,node_ptr->data); B(node_ptr->left); B(node_ptr->right); } }
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 09/21/2011.

Page1 / 5

CS1050605b - Computer Science Foundation Exam May 6, 2005...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online