How could you use recursion to find the smallest value in an array? Don't write out Java code, just write out the pseudocode.
Create an array from which to pull values from.
Create a recursion method that compares two values from the array at a time.
Through process of elimination, only keep the least number of the current comparisons you are making, pairing values off after larger values have been eliminated until you are left with the smallest value.
Monday, July 21, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment