D Question 36 The code to the right contains a syntax error. Which of the following best explains the reason for the syntax error? A. is not a valid identifier. b3 byte b1 = 3; B. The operator is not defined for the type + byte. byte b2 = 10; byte b3 = b1 + b2; C. The literals and may not be assigned int 3 10 to variables of type byte. D. is not a valid Java type. byte E. The expression evaluates to the type b1 + b2 and cannot be assigned to a variable. int byte B Question 37 What is the result of a post order traversal of the binary tree shown to the right? A. PORRET B. ROPTER C. PORTER D. E. TERROP ROPERT B Question 38 Which of the following can replace in the code to <*1> the right as the type variable for the class to Structure indicate that the class is generic? Structure I. AnyType II. E III. myThings } A. I only B. II only C. III only D. I and II E. I, II, and III only } Assume <*1> is filled in correctly. B Question 39 If a object contains N elements what is the Structure } Big O of the method the remove Structure Pick the most restrictive correct answer. A. O(N) B. O(NlogN) C. O(N3/2) } D. O(N2) E. O(1) B Question 40 } What type of data structure does the class Structure } implement? A. a list B. a C. a hashtable
Question 36 D byte b1 = 3; byte b2 = 10; byte b3 = b1 + b2; The code to the right contains a syntax error. Which of the following best explains the reason for the syntax error? A. b3 is not a valid identifier. B. The + operator is not defined for the type byte. C. The int literals 3 and 10 may not be assigned to variables of type byte. D. byte is not a valid Java type. E. The expression b1 + b2 evaluates to the type int and cannot be assigned to a byte variable. Question 37 B What is the result of a post order traversal of the binary tree shown to the right? A. PORRET B. ROPTER C. PORTER D. TERROP E. ROPERT Question 38 B } } } } } } Which of the following can replace <*1> in the code to the right as the type variable for the Structure class to indicate that the Structure class is generic? I. II. III. AnyType E myThings A. I only B. II only C. III only D. I and II only E. I, II, and III Assume <*1> is filled in correctly. Question 39 B If a Structure object contains N elements what is the Big O of the remove method the Structure Pick the most restrictive correct answer. A. O(N) B. O(NlogN) C. O(N3/2) D. O(N2) E. O(1) Question 40 B What type of data structure does the Structure class implement? A. a list B. a C. a hashtable
UTCS_INV.docx