Newton's method script for HW 1
Homework #1 exercise 3 algorithm implementation, quickselect