Re: Recursive functions



In article <1175456107.493063.221730@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Bill Pursell <bill.pursell@xxxxxxxxx> wrote:
Because it is totally inappropriate to use a recursive
function to compute the length of a string.

"Totally inappropriate" apparently means here "inefficient on a
typical C implementation". That is certainly true, but not always
crucial. Even the space performance isn't an issue if the lengths of
all argument strings are known to have a reasonable bound.

Efficiency aside, recursion is certainly a natural way of defining the
length of a sequence.


Lauri
.



Relevant Pages

  • Re: Recursive functions
    ... function to compute the length of a string. ... It is a natural way of defining the length of a finite sequence ... it IS totally inappropriate to compute ... not mean "inefficient in a typical C implementation". ...
    (comp.lang.c)
  • Re: Recursive functions
    ... recursion is certainly a natural way of defining the ... it IS totally inappropriate to compute ... not mean "inefficient in a typical C implementation". ... If I had an actual requirement to print the string ...
    (comp.lang.c)
  • Re: Moved from C++ to Delphi
    ... >which is inefficient. ... LStrLen does not have to scan the string, ... doing string manipulations, then you need to find something more ...
    (borland.public.delphi.language.objectpascal)
  • Re: Monitor unblock priority
    ... > Trying to synchronize threads in a fixed/predetermined order is highly ... could show you a string being built up inefficiently, ... problem to the one originally posed, namely releasing threads in the ... inefficient, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Is this a dumb way to count chars in a string?
    ... the use of LSet explicitly prevents String creation ... I don't know if it is inefficient but the split function is working great ... Maybe I'll try a version using your counting method and try some time ...
    (microsoft.public.vb.general.discussion)