aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordrbaggy <js5@sanger.ac.uk>2021-06-18 07:04:09 +0100
committerdrbaggy <js5@sanger.ac.uk>2021-06-18 07:04:09 +0100
commit5ecea517efd54a3aed4a3b26208b5c498786a07b (patch)
tree40bdc79e4591319e782495d6c7a4ff7be251b899
parent90b0b5b7aff6506068bbf6497720f7e701752bb7 (diff)
parent419787187210ea2f71d7fb4aad6deea50da34a99 (diff)
downloadperlweeklychallenge-club-5ecea517efd54a3aed4a3b26208b5c498786a07b.tar.gz
perlweeklychallenge-club-5ecea517efd54a3aed4a3b26208b5c498786a07b.tar.bz2
perlweeklychallenge-club-5ecea517efd54a3aed4a3b26208b5c498786a07b.zip
Merge branch 'master' of github.com:drbaggy/perlweeklychallenge-club
-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 {