You are managing a software project that involves building a computer-assisted instrument for medical surgery. The exact placement of the surgical knife is dependent on a number of different parameters, usually at least 25, sometimes more. Your programmer has developed two algorithms for positioning the cutting tool, and is seeking your advice about which algorithm to use:
Algorithm A has an average – case run time of n, and a worst case run time of n^4, where n is the number of input parameters.
Algorithm B has an average case run time of n[(log n)^3], and a worst case of n^2. Which algorithm would you favour for inclusion in the software? Justify your answer.
I think i should choose algorithm 1 because in medical science we must be more focused towards saving life of more people hence average case should be better however for worst case we can apply some optimization to work better or we can choose algorithm 2. But i m confused how to proof it Mathematically that i am correct.
For all interested readers. However i have marked first answer good but actually to get all the perspective do read comments and second answer.