Our website uses necessary cookies to enable basic functions and optional cookies to help us to enhance your user experience. Learn more about our cookie policy by clicking "Learn More".
Accept All Only Necessary Cookies
Graham Scan icône

1.0 by Tanishq Saluja


Apr 14, 2018

À propos de Graham Scan

le balayage de Graham est une méthode de recherche de l'enveloppe convexe d'un ensemble fini de points

The first step in this algorithm is to find the point with the lowest y-coordinate. If the lowest y-coordinate exists in more than one point in the set, the point with the lowest x-coordinate out of the candidates should be chosen. Call this point P. This step takes O(n), where n is the number of points in question.

Next, the set of points must be sorted in increasing order of the angle they and the point P make with the x-axis. Any general-purpose sorting algorithm is appropriate for this, for example heapsort (which is O(n log n)).

The algorithm proceeds by considering each of the points in the sorted array in sequence. For each point, it is first determined whether traveling from the two points immediately preceding this point constitutes making a left turn or a right turn. If a right turn, the second-to-last point is not part of the convex hull, and lies 'inside' it.

Sorting the points has time complexity O(n log n). While it may seem that the time complexity of the loop is O(n2), because for each point it goes back to check if any of the previous points make a "right turn", it is actually O(n), because each point is considered at most twice in some sense. Each point can appear only once as a point ( x 2 , y 2 ) in a "left turn" (because the algorithm advances to the next point ( x 3 , y 3 )after that), and as a point ( x 2 , y 2 ) in a "right turn" (because the point ( x 2 , y 2 ) { is removed). The overall time complexity is therefore O(n log n), since the time to sort dominates the time to actually compute the convex hull.

Quoi de neuf dans la dernière version 1.0

Last updated on Apr 14, 2018

Minor bug fixes and improvements. Install or update to the newest version to check it out!

Chargement de la traduction...

Informations Application supplémentaires

Dernière version

Demande Graham Scan mise à jour 1.0

Nécessite Android

4.2 and up

Voir plus

Graham Scan Captures d'écran

Charegement du commentaire...
Abonnez-vous à APKPure
Soyez le premier à avoir accès à la sortie précoce, aux nouvelles et aux guides des meilleurs jeux et applications Android.
Non merci
S'inscrire
Abonné avec succès!
Vous êtes maintenant souscrit à APKPure.
Abonnez-vous à APKPure
Soyez le premier à avoir accès à la sortie précoce, aux nouvelles et aux guides des meilleurs jeux et applications Android.
Non merci
S'inscrire
Succès!
Vous êtes maintenant souscrit à notre newsletter.