Talk:Convex hull: Difference between revisions

no edit summary
mNo edit summary
No edit summary
Line 66:
 
It should be
 
 
int t = hLen + 1;
for (i = len - 1; i >= 0; i--) {
Line 76 ⟶ 78:
break;
}
 
 
: You should test the code, and think about the results here. For example, "ccw" is a routine which determines whether the winding is clockwise or counterclockwise. But from which side? Anyways... since that's not a documented issue... ccw should work regardless of the winding direction -- as long as the winding direction is consistent. So... you have encountered a real issue here. But it's probably not a code correctness issue -- it's probably a lack of adequate documentation issue (which is a frequent problem for coders).
Line 81 ⟶ 84:
: That said, taking a close look at the implementation, like you have done here, is great. We all-too-often have had errors in code here on this site -- often for very understandable reasons. So double checking results is frequently a good thing. Thanks!
: 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 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 !
Trap D
Anonymous user