DevPinoy.org
A Filipino Developers Community
Sign in
|
Join
|
Help
Home
Blogs
Media
Forums
Groups
DevCast
Forums
»
Community Central
»
The Lounge
»
Programming Trivia's
»
Trivia for the weekend: Get the number of occurrences of text in a string
>>> First two to make 3 wins! <<<
Trivia for the weekend: Get the number of occurrences of text in a string
rated by 0 users
This post has 17 Replies | 0 Followers
Posts
80
Points 1,210
Reply
trashVin
replied on
05-09-2006 2:13 AM
rated by 0 users
correct me if im wrong , but the problem stated no looping required . is recursion not looping , in my opinion looping can be implemented using iteration (for,while) or recursion .
need feedback on this.. thanks.
| Post Points: 20
Posts
232
Points 3,130
Reply
bonskijr
replied on
05-09-2006 7:19 AM
rated by 0 users
^^^ well you could say that recursion is a form of implicit looping whereas the (for, while) are all explicit loop constructs.. why implicit? the loop isn't obvious, recursion calls itself to loop. that's why there was a solution of just deducting the length of target string from the source string..
| Post Points: 20
Posts
498
Points 8,375
Reply
cvega
replied on
05-09-2006 7:27 PM
rated by 0 users
According to programming language standards, recursion is a form of repeating a task by means of calling itself (also known as self-branching), where the repeat is determined by task-reduction (action, recurse, case).
Looping on the other hand is performing a set of repeated task in
complete circuit
(iterator, condition, count), and the branch must be in a circuit, otherwise it will prematurely terminate a loop.
That's why in programming language standards (at least in the C family of programming language), recursion (recursive calls) is not considered as a loop, becuase it doesn't need to complete a circuit to repeat a task.
Regards,
-chris
Chris Vega
This posting is provided "AS IS" with no warranties, and confers no rights
My Weblog
|
Visit MSDN Community
| Post Points: 5
Previous
|
Next
Page 2 of 2 (18 items)
< Previous
1
2 |
RSS
Copyright DevPinoy 2005-2008