Perhaps you mean O(n) space (#1871)
This commit is contained in:
parent
9b1c71a381
commit
12febe5cc2
|
@ -195,7 +195,7 @@ of recursive calls instead of a looping construct, then read on.
|
||||||
@section[#:tag "tail-recursion"]{Tail Recursion}
|
@section[#:tag "tail-recursion"]{Tail Recursion}
|
||||||
|
|
||||||
Both the @racket[my-length] and @racket[my-map] functions run in
|
Both the @racket[my-length] and @racket[my-map] functions run in
|
||||||
@math{O(n)} time for a list of length @math{n}. This is easy to see by
|
@math{O(n)} space for a list of length @math{n}. This is easy to see by
|
||||||
imagining how @racket[(my-length (list "a" "b" "c"))] must evaluate:
|
imagining how @racket[(my-length (list "a" "b" "c"))] must evaluate:
|
||||||
|
|
||||||
@racketblock[
|
@racketblock[
|
||||||
|
|
Loading…
Reference in New Issue
Block a user