Talk:Convex hull: Difference between revisions

Content added Content deleted
No edit summary
No edit summary
Line 67: Line 67:
It should be
It should be


int t = hLen + 1;

for (i = len - 1; i >= 0; i--) {
int t = hLen + 1;
for (i = len - 1; i >= 0; i--) {
while (hLen >= t)
while (hLen >= t)
hptr = h;
hptr = h;
while (hptr->next->next != NULL){
hptr = hptr->next;
while (hptr->next->next != NULL){
}
hptr = hptr->next;
if (ccw(&hptr->next->data, &hptr->data, &p[i])) {
}
break;
if (ccw(&hptr->next->data, &hptr->data, &p[i])) {
}
break;
}




Line 85: Line 84:
: P.S. please sign your comments on the talk pages, using <nowiki>--~~~~</nowiki>. This helps readers comprehend talk pages. --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 21:07, 22 December 2020 (UTC)
: P.S. please sign your comments on the talk pages, using <nowiki>--~~~~</nowiki>. This helps readers comprehend talk pages. --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 21:07, 22 December 2020 (UTC)


I'm sure of these errors because I tried this code for an exercice on Codingame (Encounter Surface) and I didn't get the good results.
:I'm sure of these errors because I tried this code for an exercice on Codingame (Encounter Surface) and I didn't get the good results.
I compare with C++ and Java codes, found the mistakes, correct then as I explain and now it works !
:I compare with C++ and Java codes, found the mistakes, correct then as I explain and now it works !
May be the code is correct for the data given but it's wrong !
:May be the code is correct for the data given but it's wrong !
[[User:Trap D|Trap D]] ([[User talk:Trap D|talk]])
Trap D