Engineering
Engineering, 26.11.2019 01:31, csuggs8

Given n points in the plane, the convex hull is the list of points, in counter-clockwise order, that describe the convex polygon that contains all the other points. imagine a rubber band is stretched around all of the points: the set of points it touches is the convex hull. you can also play around with defining your own set of points and seeing what the polygon should

fill in the following algorithm for convex hull; you do not need to prove it correct. what is its runtime? procedureconvexhull(list of pointsp[1..n])setlow: =the point with the minimumy-coordinate, breaking ties by minimumx-coordinate. create a lists[1..n-1]of the remaining points sorted by increasing angle of vector fromlow. initializehull: = [low, s[1]]forp∈s[2..n-1]doreturnhullthis algorithm reduces convex hull to sorting in linear time: given a sorting subroutine, it allows us tosolve the convex hull problem, with the other steps taking linear time

answer
Answers: 3

Similar questions

Предмет
Computers and Technology, 21.11.2019 00:31, rissacoob7862
Givennpoints in the plane, theconvex hullis the list of points, in counter-clockwise order, that describe theconvex shape that contains all the other points. imagine a rubber band is stretched around all of the points: the set of points it touches is the convex hull.in this problem we’ll show that the convex hull problem and sorting reduce to each other in linear time.(a) fill in the following algorithm for convex hull; you do not need to prove it correct. what is its runtime? procedureconvexhull(list of pointsp[1..n])setlow: =the point with the minimumy-coordinate, breaking ties by minimumx-coordinate.create a lists[1..n-1]of the remaining points sorted by increasing angle of vector fromlow.initializehull: = [low,s[1]]forp∈s[2..n-1]doreturnhullthis algorithm reduces convex hull to sorting in linear time: given a sorting subroutine, it allows us tosolve the convex hull problem, with the other steps taking linear time.(b) now, find a linear time reduction from sorting to convex hull.in other words, given a list of realnumbers to sort, describe an algorithm that transforms the list of numbers into a list of points, feedsthem into convex hull, and interprets the output to return the sorted list. then, prove that your reductionis correct.for this problem, do not assume you can do arithmetic operations in constant time: take into accounttheir actual runtime.(c)this part has been removed because it assumes a comparison-based sort. we can’t give a lower-boundfor sorting in general without also considering the lengths (log of magnitudes) of the numbers.giventhatwe’veseenanω(nlogn),whatinformationdoespart(b)? explainbriefly.
Answers: 1
Do you know the correct answer?
Given n points in the plane, the convex hull is the list of points, in counter-clockwise order, that...

Questions in other subjects:

Konu
Mathematics, 29.05.2020 17:01
Konu
Physics, 29.05.2020 17:01