aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Smith <baggy@baggy.me.uk>2021-06-18 07:03:01 +0100
committerGitHub <noreply@github.com>2021-06-18 07:03:01 +0100
commit419787187210ea2f71d7fb4aad6deea50da34a99 (patch)
treedecbcd9c0f25bfb1302e2a1101647067afbadf38
parent4b681fc5f809dec0d649a740ce24b2b9f03087eb (diff)
downloadperlweeklychallenge-club-419787187210ea2f71d7fb4aad6deea50da34a99.tar.gz
perlweeklychallenge-club-419787187210ea2f71d7fb4aad6deea50da34a99.tar.bz2
perlweeklychallenge-club-419787187210ea2f71d7fb4aad6deea50da34a99.zip
Update README.md
-rw-r--r--challenge-117/james-smith/README.md10
1 files changed, 7 insertions, 3 deletions
diff --git a/challenge-117/james-smith/README.md b/challenge-117/james-smith/README.md
index 07571f0918..e17e38bcbc 100644
--- a/challenge-117/james-smith/README.md
+++ b/challenge-117/james-smith/README.md
@@ -53,7 +53,10 @@ sub triangle {
}
```
-### Now the counts... Schroder numbers
+Note we don't "collect" routes in a datastructure and then print them all at the end, but instead render directly from within the
+function. For `$N` larger than `10` the memory requirements for storing this information increases significantly, so this code is limited purely by disk rather than memory.
+
+### Now the counts... Schröder numbers
*It's amazing what you find out about when you google the answers you get!*
@@ -99,8 +102,9 @@ sub schroder_non_recursive {
We again use the row "flip" as we only need one row and the previous
one to get values...
-There is a faster solution - in that the Scrhoder numbers can be
-written as a recurrence relation:
+Googling for `2, 6, 22, 90, 394` came up with https://en.wikipedia.org/wiki/Schröder_number, a page
+about Schröder numbers - which gives up the following faster (about twice as fast as above) solution -
+as Scrhoder numbers can be written as a recurrence relation:
```perl
sub schroder_recurrence_rel {