From: Kenneth Wolcott <kennethwolcott@gmail.com>
Subject: memoization in Ada? Hash ADT?
Date: Fri, 21 Jul 2023 20:50:04 -0700 (PDT) [thread overview]
Message-ID: <1f6ad7f7-3bd3-4094-b037-eac7d352d68dn@googlegroups.com> (raw)
Hi;
I'm working on the Rosetta Code task:
"Stirling numbers of the second kind"
I have a working recursive solution written in Ada but I'd like to memoize it to cut down on the redundant and duplicative calls (similar to a recursive solution to calculating the Fibonacci sequence).
So I think I need a hash ADT (which I've used in Perl) but I've never used in Ada.
So I want to preserve the calculation of the Stirling2 for each N and K so I can do a lookup. If this were based on a single unsigned integer, an array would suffice. Maybe a 2d array would suffice?
Thanks,
Ken Wolcott
next reply other threads:[~2023-07-22 3:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-22 3:50 Kenneth Wolcott [this message]
2023-07-22 5:30 ` memoization in Ada? Hash ADT? Kenneth Wolcott
2023-07-24 21:18 ` Gautier write-only address
2023-07-26 4:38 ` Kenneth Wolcott
2023-07-26 7:50 ` Simon Wright
2023-07-26 21:36 ` Gautier write-only address
2023-07-26 22:18 ` Kenneth Wolcott
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox