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
Computer programs can be very complex, containing thousands (or millions) of lines of code and performing millions of operations per second. Given this, how can we possibly know that a particular computer program's results are correct? Do some research on this topic then think carefully about your response. Also, explain how YOU would approach testing a large problem. Your answer must be thoughtful and give some insight into why you believe your steps would be helpful when testing a large program.
Could you fix this? My marker has commented, What's missing? The input list is the link below.  https://gmierzwinski.github.io/bishops/cs321/resources/CS321_Assignment_1_Input.txt     result.put(true, dishwasherSum);        result.put(false, sinkSum);        return result;    }}
PLEG136: Week 5 Portofolio Project Motion to Compel
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Operations Research : Applications and Algorithms
Computer Science
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Brooks Cole
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
Fundamentals of Information Systems
Computer Science
ISBN:9781305082168
Author:Ralph Stair, George Reynolds
Publisher:Cengage Learning