Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

which one is faster loop or recursive function?

No, recursion isn't faster than loops, because loops have built-in support in CPUs, whereas recursion is implemented using the generally slower function call / return mechanism. That said, recursion can be made to be as fast as loops by a good compiler, when the code is properly written
 
PREVIOUS NEXT
Tagged: #faster #loop #recursive
ADD COMMENT
Topic
Name
9+2 =