Question

In: Advanced Math

Computational Geometry: Let E be an unsorted set of n segments that are the edges of...

Computational Geometry:

Let E be an unsorted set of n segments that are the edges of a convex polygon. Describe an O(nlogn) algorithm that computes from E a list containing all vertices of the polygon, sorted in clockwise order.

Don't copy other peoples wrong answer or you get down-voted.

Solutions

Expert Solution


Solution:

We have the set of all points of the polygonal shape In set E., that is unsorted to type within the clockwise direction
these points we've to divide the polnts Into 2 sets. for this, we've to search out min(X) and max(X) within the
set of points. If min(X) or max(X) are multiple then think about the min(X) that have less Y worth, consider
max(x) that have bigger Y worth. Then divide the set into 2 parts:


1. Points below the road connection min(X) and max(X). [ purpose with max(X) can be a part of this set]
2. Points on top of the road connection min(X) and max(X). [point with min(x) can be a part of this set ]

from thje above explantion we can see that the following task is to type these 2 set of points. type the primary set in descendant order per X
coordinate (If the worth of X is that the same then type like the Y coordinate value)

. Similarly,


by sorting the second set in ascending order as per X coordinate (if the worth of X is that the same then type
corresponding to the Y coordinate value)

.* it takes " O"(n logn) time to type all polnts exploitation
*merge or fast type (Standard perform in c++ take n (logn) time to type the list).
Now be a part of each sets and duplicate to line E. The set E currently sorted in clockwise order


Related Solutions

You are given a directed graph G(V,E) with n vertices and m edges. Let S be...
You are given a directed graph G(V,E) with n vertices and m edges. Let S be the subset of vertices in G that are able to reach some cycle in G. Design an O(n + m) time algorithm to compute the set S. You can assume that G is given to you in the adjacency-list representation.
7. Let n ∈ N with n > 1 and let P be the set of...
7. Let n ∈ N with n > 1 and let P be the set of polynomials with coefficients in R. (a) We define a relation, T, on P as follows: Let f, g ∈ P. Then we say f T g if f −g = c for some c ∈ R. Show that T is an equivalence relation on P. (b) Let R be the set of equivalence classes of P and let F : R → P be...
Count Valence e- Formula Electron Geometry Molecular Geometry 1 N = 5 3 H = 3...
Count Valence e- Formula Electron Geometry Molecular Geometry 1 N = 5 3 H = 3 8 / 2 = 4 pair NH3 Tetrahedral Trigonal pyramidal H2O CBr4 SO3 This is not a polyatomic ion … No charge!!! PI3 CH3Cl Carbon is the central atom NO31- CO32- NH4+1 CH4 SO2
Let S be a set of n numbers. Let X be the set of all subsets...
Let S be a set of n numbers. Let X be the set of all subsets of S of size k, and let Y be the set of all ordered k-tuples (s1, s2,   , sk) such that s1 < s2 <    < sk. That is, X = {{s1, s2,   , sk} | si  S and all si's are distinct}, and Y = {(s1, s2,   , sk) | si  S and s1 < s2 <    < sk}. (a) Define a one-to-one correspondence f : X → Y. Explain...
Given an undirected graph G = (V,E), consisting of n vertices and m edges, with each...
Given an undirected graph G = (V,E), consisting of n vertices and m edges, with each edge labeled from the set {0,1}. Describe and analyze the worst-case time complexity of an efficient algorithm to find any cycle consisting of edges whose labels alternate 0,1.
Let set E be defined as E={?∙?? +? | [?]∈R2}, where ?? is the natural exponential?...
Let set E be defined as E={?∙?? +? | [?]∈R2}, where ?? is the natural exponential? function, please show E is a vector space by checking all the 10 axioms. (Notice: you may use the properties of vector addition and scalar multiplication in R2)
Let sequence an be a bounded sequence and let E be the set of subsequential limits...
Let sequence an be a bounded sequence and let E be the set of subsequential limits of an. prove that E is bounded and contains both sup E and inf E
Let “ ·n” be multiplication modulo n, and consider the set Un = { [a] ∈...
Let “ ·n” be multiplication modulo n, and consider the set Un = { [a] ∈ Zn | there is a [b] ∈ Zn with [a] ·n [b] = [1]} (a) Show that (Un, ·n ) is a group. (b) Write down the Cayley table for U5. Hint: |U5| = 4. (c) Write down the Cayley table for U12. Hint: |U12| = 4.
Graph Theory: Let S be a set of three pairwise-nonadjacent edges in a 3-connected graph G....
Graph Theory: Let S be a set of three pairwise-nonadjacent edges in a 3-connected graph G. Show that there is a cycle in G containing all three edges of S unless S is an edge-cut of G
c) Let R be any ring and let ??(?) be the set of all n by...
c) Let R be any ring and let ??(?) be the set of all n by n matrices. Show that ??(?) is a ring with identity under standard rules for adding and multiplying matrices. Under what conditions is ??(?) commutative?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT