I need help writing a recursive minimum function. For the minimum function, lets say you have an array like 5,12,15,20. You would split it in half, so on one side you get 5 and 12 and the other 15 and 20. Therefore you compare 5 and 12 and 5 wins, then you compare 15 and 20 and 15 wins. Then you compare 5 and 15 and 5 wins, making that the minimum.
My brother sent me something but it looks way to complicated. Can someone make the same function but with less lines? Thanks for any help!!!
The general approach might be: The minimum over all N elements is the minimum of the first element and the minimum of the N-1 remaining elements. That reduces the problem to finding the minimum of an actual number and the result of a recursive call.
But nobody here will just give you some code - this is an assignment that you should be doing. How are you going to learn if you hand in someone else's solution? [ May 07, 2007: Message edited by: Ulf Dittmer ]
Ping & DNS - updated with new look and Ping home screen widget