Closest To Origin Assignment

From CSE425S Wiki
Jump to navigation Jump to search

Code to Implement

file: src/main/sml/warmup_closest_to_origin/closest_to_origin.sml Smlnj-logo.png
functions: closest_to_origin

closest_to_origin

Write a function

fun closest_to_origin(xys : (int*int) list) : (int*int) option

which optionally returns closest point to the origin, if it exists.

Test

file: unit_test_closest_to_origin.sml
source folder: src/test/sml/warmup_closest_to_origin