1. Correct answer: C. WYSE Academic Challenge Regional 2008 Solution Set 8 bits are sent at each clock cycle and there are 1,000,000 cycles per second, so 8,000,000 bits per second or 1,000,000 bytes per second are transmitted. 2. Correct answer: B. Main memory (ram) is faster and generally more expensive than secondary storage. One of the reasons that main memory is faster is that it has no moving parts. So, it is not cheaper and the fact that it has no moving parts is an advantage, not a disadvantage. However, when powered down, main memory does not preserve the state it was in, causing all data to be lost unless it is saved to the hard drive before being powered down. 3. Correct answer: C. An asymmetric connection is not symmetric because it allows for the maximum amount of data that the client can receive to be greater than it can send. This is done because the service providers expect their customers to request more data than they provide in general. 4. Correct answer: B. HTML is the hypertext markup language. It is used for formatting the webpage, but is not a programming language. All others are programming languages that can be used to create dynamically changing websites. 5. Correct answer: D. DeMorgan's Law can be written in the form listed above or in the alternate format of not(a or B) = not A and not B. 6. Correct answer: D. The values are the opposite of C for each row. 7. Correct answer: A. Each bit can represent 2 different states, 0 or 1. There are 12 different bits. So, there are two ways for each of the 12 bits to be set resulting in 2 12 combinations. 8. Correct answer: D. 75 in base 16 is equivalent to 7 * 16 + 5 = 117 decimal. To convert it to binary, you may convert each of the hexadecimal digits independently, so: 7 = 4 + 2 + 1 = 0*2 3 + 1*2 2 + 1*2 1 + 1*2 0 = 0111 5 = 4 +1 = 0*2 3 + 1*2 2 + 0*2 1 + 1*2 0 = 0101 Combining the results yields from 7 (0111) and then 5 (0101), yields 01110101.
9. Correct answer: A. The logic for the expression is below. not ((A and B) and (B or C)) The logical circuit as an equation not ((T and F) and (F or C)) Substituting for A and B: not ((F) and (F or C)) Any and with a F is F not ((F and C)) Or is dependent upon C only not (F) Same reason as above T not F is T It might be quicker to notice that as A and B are false, the last nand gate is going to be true no matter what the value of C is, because one of the inputs to the nand is already false. The truth table for the nand is given below. X Y X nand Y F F T F T T T F T T T F 10. Correct answer: A. The logic for the expression is below. (C and A) or (A and not B) Substitute in A and B (C and T) or (T and not F) Substitute in A and B (C and T) or (T and T) not F is T (C and T) or T T and T is T T Logical or of anything with T is T 11. Correct answer: D. j x Output 0 2 261426 1 4 2 6 3 8 4 10 12. Correct answer: B. j starts at 1, goes to 0, 1, 2, 3, 4 and then terminates. While the loop does not run for the value of 4, j still reaches the value of 4. 13. Correct answer: A. a b c d 0 2 4 6 Considering the first if statement a==b F a==b&&c F Thus!(F)=T, and by short-circuit logic the statement is true. Therefore a+b+c+d =12
14. Correct answer: E. n i f1 f2 f Action 5 0 1 0 0 5 2 1 0 0 5 2 1 0 1 5 2 1 1 1 print f or 1 5 3 1 1 1 5 3 1 1 2 5 3 2 1 2 print f or 2 5 4 2 1 2 5 4 2 1 3 5 4 2 2 3 5 4 3 2 3 print f or 3 *** 5 5 3 2 3 5 5 3 2 5 5 5 3 3 5 5 5 5 3 5 print f or 5 5 6 5 3 5 Output 1235 15. Correct answer: D. The code will trace the same way as the last problem, but it will stop at the spot where the three * are placed. 16. Correct answer: D. Recursive functions are those that call themselves. 17. Correct answer: A. n i f1 f2 f Output 4 0 8 8 0 0 2 0 8 4 1 9 7 0 4 2 10 6 2 4 3 11 5 0 4 4 12 4 8 4 5 18. Correct answer: C. The loop is entered (n-1) + 1 or n times. 19. Correct answer: E. A trace of the code is provided below. i 0 0/2 is 0, print i or 0 1 1/2 is 0, print i or 1 2 2/2 is 1, print 2/2 or 1 and then because there is no break, print 7 3 3/2 is 1, print 3/2 or 1 and then because there is no break, print 7 4 4/2 is 2, print 7 5 5/2 is 2, print 7
20. Correct answer: A. A trace of the actions follows. Action Stack PUSH A, A PUSH B, BA POP, A POP, empty PUSH C, C PUSH D, DC POP C 21. Correct answer: C. A trace for the code follows. i j s action 0 0 0 0 0 1 s = s + A[i][j] 0 1 1 j++ 1 1 1 j not less than i, do ends for increments i 1 0 1 j set back to zero 1 0 5 s = s + A[1][0] 1 1 5 j++ 2 1 5 j not less than i, do ends for increments i 2 0 5 j set back to zero 2 0 12 s = s + A[2][0] 2 1 12 j++ 2 1 20 s = s + A[2][1] 2 2 20 j++ 3 2 20 do loop ends, for loop increments i, but ends OUTPUT 20 22. Correct answer: B. A do/while loop will always run a minimum of once. 23. Correct answer: E. The nested loop will run 1+1+2+3+...+(n-1) which would equal ((n-1)n/2+1, which is O(n 2 ). 24. Correct answer: B. The OOP paradigm is centered around the idea of representing real world entities and then the algorithms needed to manipulate these entities. 25. Correct answer: C. The if statement only executes once, so it cannot be used to execute a code block repeatedly. 26. Correct answer: B. A postorder traversal will visit the left child node, the right child node and then the parent or vertex last.
27. Correct answer: E. A queue has insertions at the rear and deletions at the front. 28. Correct answer: E. A trace of the actions follows. Action Queue INSERT A, A REMOVE, INSERT B, B REMOVE, INSERT C, C INSERT D, DC REMOVE, D INSERT E, ED REMOVE E 29. Correct answer: C. In OOP a constructor is a class method that is automatically called when an instance of a class is declared. The constructor is usually used to initialize variables. 30. Correct answer: E. These are all aspects of OOP.