1. Give asymptotic upper and lower bounds for T(n) in each of the following recurrences using
Ξ-notation. Assume that T(n) is constant for sufficiently small values of n. Justify your answers. a) T(n) = 9T(n/3) + n + 3011 (1 mark)
β β
2. Consider the following problem:
Input: Two unsorted lists A and B of numbers.
Output: βYESβ if some number belongs to both A and B; βNOβ otherwise.
Let m be the length of A and let n be the length of B. Design a fast algorithm for the special case of the problem where m is much smaller than n and analyze its time complexity. When m = O(lgn), your algorithm must have a worst-case running time of o(nlgn).
3. Give an O(lgn)-time algorithm for the following problem, justify why it works, and analyze its time complexity.
Input: A sorted array A[1..n] of distinct integers.
Output: Any index i such that A[i] = i, if such an index exists; β1 otherwise.
4. In this question, we shall use the definitions below.
β’ Let G = (V,E) be a graph and let k be a positive integer. A k-coloring of G is a partition of V into disjoint subsets V1,V2,V3,…,Vk called color classes such that for any {x,y} β E, it holds that x and y belong to different color classes, i.e., x β Vi and y β Vj with i 6= j. A minimum graph coloring of G is a k-coloring of G for the smallest possible integer k.
β’ For every positive integer n β₯ 3, define the cycle graph Cn as the graph (Vn,En), where
Vn = {x1,x2,…,xn} and .
β’ The degree of a vertex x in graph, denoted by deg(x), is the number of neighbors of x.
(Continued ββ)
1
The greedy graph coloring algorithm takes as input an undirected graph G = (V,E) and does the following:
Fix any ordering hv1,v2,…,vni of V such that deg(vi) β₯ deg(vi+1) for every i β {1,2,…,nβ1}. for i = 1,2,…,n
Assign vertex vi the smallest color not used by any of its neighbors.
5. Suppose that P is a sequence of points in the plane. Any point (x,y) β P is called maximal with respect to P if there is no (x0,y0) β P with (x,y) 6= (x0,y0) for which both x β€ x0 and y β€ y0 hold. The set of all points in P that are maximal with respect to P is denoted by M(P). For example, if P = h(3, 4), (5, 2.5), (1, 5), (4, 4), (2.8, 2)i then M(P) = {(1, 5), (4, 4), (5, 2.5)}.
2
[SOLVED] COMP3011 Assignment 1
30.00 $
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
Securely Powered by:
- A1-i69on5.zip



