Question
1. You are given two sorted lists of size m and n. Give an O(logm + logn) time algorithm for computing the k-th smallest element
1. You are given two sorted lists of size m and n. Give an O(logm + logn) time algorithm for computing the k-th smallest element in the union of the two lists. Note that the only way you can access these values is through queries to the databases. Ina single query, you can specify a value k to one of the two databases, and the chosen database will return the k-th smallest value that it contains. Since queries are expensive, you would like to compute the median using as few queries as possible. Give an algorithm that nds the median value using at most O(logm + logn) queries.
2. We are given a directed graph G = (V,E) on which each edge (u,v) E has an associated value r(u,v), which is a real number in the range 0 r(u,v) 1 that represents the reliability of a communication channel from vertex u to vertex v. We interpret r(u,v) as the probability that the channel from u to v will not fail, and we assume that these probabilities are independent. Give an ecient algorithm to nd the most reliable path between two given vertices. You do not have to analyze the algorithms running time. It should be a polynomial running-time algorithm.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started