Question: ( a ) Suppose you are given an array A [ 1 . . n ] of numbers. What is the fastest running time we
a Suppose you are given an array A n of numbers. What is the fastest running
time we saw for finding the nth smallest number in A
b Let X nn be a D array of numbers. Consider the function Boingi j
defined recursively as follows:
Boingi j
if i n or j
Xi j max Boingi jBoingi j otherwise
In terms of n how long does it take to compute Boing n using dynamic programming?
c Suppose you are given a directed acyclic graph G V E and you compute a
postorder of its vertices using DFSAllG What is special about the reversal of this
postorder?
d Suppose you are given an undirected graph G V E with distinct real edge
weights w : E R You can find the minimum spanning tree of G using Kruskals
algorithm. It consists of two phases, sorting the edges by weight and scanning the
edges whereby you add each edge that doesnt create a cycle to the intermediate
spanning forest.
Assuming use of a good unionfind data structure and comparisonbased sorting
algorithm, which of the two phases has a larger worst case running time?
e Let G V E with s t in V be a flow network with nonnegative edge capacities
c : E R
Let f be a maximum value feasible s tflow, and let S T be a
minimum capacity s tcut. What must be true about f uw for each u in S and
w in T This is a practice exam question my professor gave me Could you help me solve these problems with only logic, no code.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
