SOLUTIONS RATED A+
✔✔Can a multithreading program take a longer time than a single thread program that
solves the same problem? - ✔✔yes
✔✔Why do we need the spin synchronization at the end of a MapReduce process? A)
To improve the performance of multithreading, or B) To make sure that all the threads
complete their tasks - ✔✔B
✔✔"Map and Reduce" is a concept for defining A) generic type, or B) parallel computing
process. - ✔✔B
✔✔In Scheme, what will the primitive (char? "#\A") will return? - ✔✔#t
✔✔What will (member '2 '(3 4 2 1)) return in Scheme? - ✔✔(2 1)
✔✔What will (caddr '(2 4 6 8 10)) return in Scheme? - ✔✔6
✔✔The most efficient way, in terms of the execution time, to check whether a list L is
empty is by what in Scheme? - ✔✔(NULL? L)
✔✔Which of the following forms is an unnamed procedure? A) (+ z 3), or B) ((lambda
(z) (+ z 3)) 4) - ✔✔B
✔✔Eager evaluation evaluates A) a parameter of a function only if it is necessary, or B)
all parameters of a function first. - ✔✔B
✔✔Lazy evaluation evaluates A) a parameter of a function only if it is necessary, or B)
all parameters of a function first. - ✔✔A
✔✔In imperative languages, different orders of evaluations (eager or lazy) (always,
may, never) produce different results. - ✔✔may
✔✔In functional languages, different orders of evaluations (eager or lazy) (always, may,
never) produce different results. - ✔✔never
✔✔Each let-form in Scheme can be converted into what? - ✔✔an unnamed procedure
✔✔Assume that you have (define x '(5)) and (define y '(8 9)). What operations will return
the list (5 8 9)? - ✔✔(append x y)
, ✔✔Which of the following is NOT a Scheme pair? A) '(), or B) '(x . y) - ✔✔A
✔✔What is the return value of the following form? (filter (lambda (x) (> x 20)) '(10 30 15
10 80)) - ✔✔(30 80)
✔✔A deep-filter can be used in the situation where the list A) contains sublists, or B) is
a plain list. - ✔✔A
✔✔What is the return value of the following form? (map (lambda (x) (+ x 10)) '(10 30
15)) - ✔✔(20 40 25)
✔✔In Scheme, is an empty list a pair? - ✔✔no
✔✔What mechanism cannot be used for passing a value into a Scheme procedure? -
✔✔call-by-alias
✔✔How is a procedure name (operator) passed into a procedure? - ✔✔call-by-name
✔✔If you want to return multiple values from a Scheme procedure, which of these
methods is invalid? A) Put the values in a pair and return the pair, or B) Use multiple
return statements - ✔✔B
✔✔Normally, a recursive procedure can be written by following these steps: Define the
size-n problem, find the solution for the base case or the stopping condition, and then,
find the solution of the A) size-n problem based on the hypothetical solution of the size-
(n-1) problem, or B) size-(n-1) problem, and finally find the solution of the size-n
problem. - ✔✔A
✔✔What notation requires parentheses in order to correctly define the order of
computation? - ✔✔infix notation
✔✔In addition to functional programming, what other ideas are originated by John
McCarthy? - ✔✔e-commerce, space fountain
✔✔One of the major differences between the imperative and functional programming
languages is that the functional programming languages do NOT A) allow a procedure
to return a value, or B) have side effects. - ✔✔B
✔✔Which of the following is a valid Scheme form? A) (* 9 (/ (- 4 2) 7)), or B) 9 * (4 - 2)/7
- ✔✔A
✔✔How does Scheme implement the function such as: for (i = 1; i< 100, i++) {sum =
sum + i;}? - ✔✔recursion