help / color / mirror / Atom feed
* memoization in Ada? Hash ADT?
@ 2023-07-22  3:50 Kenneth Wolcott
  2023-07-22  5:30 ` Kenneth Wolcott
  0 siblings, 1 reply; 7+ messages in thread
From: Kenneth Wolcott @ 2023-07-22  3:50 UTC (permalink / raw)


  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?

Ken Wolcott

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-07-26 22:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-22  3:50 memoization in Ada? Hash ADT? Kenneth Wolcott
2023-07-22  5:30 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox