new files
This commit is contained in:
parent
3af7344581
commit
86c034bb8b
1364 changed files with 21352 additions and 0 deletions
14
Task/Closest-pair-problem/PicoLisp/closest-pair-problem.l
Normal file
14
Task/Closest-pair-problem/PicoLisp/closest-pair-problem.l
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
(de closestPairBF (Lst)
|
||||
(let Min T
|
||||
(use (Pt1 Pt2)
|
||||
(for P Lst
|
||||
(for Q Lst
|
||||
(or
|
||||
(== P Q)
|
||||
(>=
|
||||
(setq N
|
||||
(let (A (- (car P) (car Q)) B (- (cdr P) (cdr Q)))
|
||||
(+ (* A A) (* B B)) ) )
|
||||
Min )
|
||||
(setq Min N Pt1 P Pt2 Q) ) ) )
|
||||
(list Pt1 Pt2 (sqrt Min)) ) ) )
|
||||
Loading…
Add table
Add a link
Reference in a new issue