Programming Assignment #1
Median exact complexity
I. V 9, 5 ( ) = 14 . Det ermine a strategy that will realize this number. Write out the
complete decision tree, omitting symmetric cases . You can separate disjoint cases onto
different pages. Carefully check all non- symmetric inputs to verify that the median is
exactly determined on every branch of the tree. (10 points)
II. Determine (1, 1, 1, 2, 2). Determine how many non- symmetric inputs need to be
checked in order to verify that your strategy works in all cases. Write and execute a
computer program to check all the necessary inputs. Be sure to supply pseudocode for
your algorithm. (10 points)
III. Consider V 16, 8 ( )
, which is known to be less than or equal to 31. A possible
strategy to achieve 30c will be sketched out in class. Your part will be to elucidate it, so
that it is clear that it applies to all cases of input. (10 points)
Extra Credit: Write a computer program to test your strategy for V 16, 8 ( )
against all
possible inputs. There are a very large number of possible inputs, although symmetrical
cases can reduce the total quite a bit. (10 points more)
Place this order with us and get 18% discount now! to earn your discount enter this code: special18 If you need assistance chat with us now by clicking the live chat button.