Gradient-based methods such as Newton's algorithm or quasi-Newton methods rely on the function being differentiable. This will not hold if the function is not continuous. Search-type algorithms will be appropriate here.