Introduction to Algorithms
Introduction to Algorithms
3rd Edition
ISBN: 9780262033848
Author: Thomas H. Cormen, Ronald L. Rivest, Charles E. Leiserson, Clifford Stein
Publisher: MIT Press
Question
Book Icon
Chapter 33, Problem 1P

a.

Program Plan Intro

To give an algorithm that takes O(n2) timeto find the convex layers of a set havingn points.

a.

Expert Solution
Check Mark

Explanation of Solution

The technique used to compute the convex hull of set Q is known as Package wrapping technique. It was given by Jarvis march.

The total running time of the algorithm is O(nh) , where h is the number of vertices of CH (Q).

And if there are K convex layers and the Introduction to Algorithms, Chapter 33, Problem 1P layer contains li points, the total running time is

  O(nl1+nl2+.+nlk)O(n2) .Since i=1Kli=n .

b.

Program Plan Intro

To prove that the time required to compute the convex layers of set having npoints is Ω(nlogn) .

b.

Expert Solution
Check Mark

Explanation of Solution

The following is the sorting problem which can be done in linear time.

  • If the numbers are given in sorted order, the convex layers can be determined in linear time.
  • Suppose there is a convex layer say A with 3 points into set Q for each A[k]:(0,0),(k,0) and (0,A[k]) .
  • Also supposeQ be withn convex layers and Qi be a triangle representation with the vertices (0,0),(n+i1,o) and (0,B[i]) .
  • Therefore, the corresponding sorted value can be obtained from each convex layer when they are converted.
  • Since, finding convex layers can be done in lower bound. The time taken to determine convex layers will be O(nlogn) and also these can be sorted in O(nlogn) time.

Hence, a convex layer takes Ω(nlogn) time.

Want to see more full solutions like this?

Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
Students have asked these similar questions
Consider eight points on the Cartesian two-dimensional xx-yy plane.   For each pair of vertices uu and vv, the weight of edge uvuv is the Euclidean (Pythagorean) distance between those two points. For example, dist(a,h) = \sqrt{4^2 + 1^2} = \sqrt{17}dist(a,h)=42+12​=17​ and dist(a,b) = \sqrt{2^2 + 0^2} = 2dist(a,b)=22+02​=2.   Using the algorithm of your choice, determine one possible minimum-weight spanning tree and compute its total distance, rounding your answer to one decimal place. Clearly show your steps.
If there is a non-singular matrix P such as P-1AP=D, matrix A is called a diagonalizable matrix. A, n x n square matrix is ​​diagonalizable if and only if matrix A has n linearly independent eigenvectors. In this case, the diagonal elements of the diagonal matrix D are the eigenvalues ​​of the matrix A.   A=({{1, -1, -1}, {1, 3, 1}, {-3, 1, -1}}) : 1 -1 -1 1 3 1 -3 1 -1   a)Write a program that calculates the eigenvalues ​​and eigenvectors of matrix A using NumPy. b)Write the program that determines whether the D matrix is ​​diagonal by calculating the D matrix, using NumPy. #UsePython
5. Let n E {3,4,5,6, ...} be fixed. Show that there are exactly two orientations of Cm with vertex set V = {0,1,2, ...,n – 1} that are %3D strongly connected.
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education