Talk:Closest-pair problem: Difference between revisions

m (→‎About this task: a silly sense correction to my own word (I always confuse the meaning of actually and currently))
Line 27:
::Their is still one outstanding point though: in the ref. I found, they stated that you had to pre-sort only once, for both X and Y ''before'' you entered the recursive routine or the sorts for Y would make the algorithm n(logn)**2 rather than nlogn. But I'm no expert in deriving O(n) notation. --[[User:Paddy3118|Paddy3118]] 12:27, 12 May 2009 (UTC)
::: Of course you're right: sorting must be done once (since once you sort, e.g. by x, splitting won't mess up the order...) That's also why the refs pass sorted sets as arguments... but while implementing it the first time, I've disregarded the question since I was more concentrated on other details... Argh. I should rewrite it all a lot better :( --[[User:ShinTakezou|ShinTakezou]] 13:03, 12 May 2009 (UTC)
Can someone test this?
Memory access bug in C version. Program crashes in closest_pair_ function.
HEAP CORRUPTION DETECTED:
CRT detected that the application wrote to memory after end of heap buffer.
Sorry, don't know how to format this reply.