Jump to content

Closest-pair problem: Difference between revisions

Line 211:
 
=={{header|D}}==
D version 2 implementation, adapted from the Python version. This code is designed for compactness instead of performance.:
<lang d>import std.stdio,std.typecons,std.math,std.algorithm,std.array,std.random;
 
Line 288:
Time gave 0:06.28 elapsed for brute force, and 0:00.07 elapsed for the divide & conquer one (10_000 points).
 
A fastermore efficient implementation of the brute-force versionalgorithm:
<lang d>import std.stdio, std.typecons, std.math, std.random;
 
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.