Recursion is a concept that took me some time to fully understand, the definition seems simple. A recursive function is a function that calls itself. Writing a recursive function for well defined, simple problems is easy enough however, as the function increases in difficulty learning recursive functions becomes, well, more difficult. Despite that, recursive functions are useful in that they are much neater than iterative functions, easier to debug and are optimal for situations where the object to be processed isn't too lengthy.
Aucun commentaire:
Enregistrer un commentaire