Great job with milestone 2!
I was able to install your package and your tests correctly came up with your functions!
Here are some things that I think you should improve:
-
For binary search, if I give it a value outside of the list ( e.g. binary_search(8, [1,2,3,4,5,6])), why does it return position = 0? Shouldn’t it give position NA or something like that?
-
I realize that your function specification is for a list of integers. Would it make sense to allow for NAs to be in your list?
-
You should put that you only allow numbers until 1000 in your documentation.
Great job with milestone 2!
I was able to install your package and your tests correctly came up with your functions!
Here are some things that I think you should improve:
For binary search, if I give it a value outside of the list ( e.g. binary_search(8, [1,2,3,4,5,6])), why does it return position = 0? Shouldn’t it give position NA or something like that?
I realize that your function specification is for a list of integers. Would it make sense to allow for NAs to be in your list?
You should put that you only allow numbers until 1000 in your documentation.