Ancestors

Written by gosha on 2025-01-27 at 06:23

The #SICP example of counting change (page 51 of the PDF) is kicking my butt, ha. It took me a really long time to understand that "using all n kinds of coins" means "you can choose freely from all the n available types of coins but don't need to use all of them". And now, as a challenge, I'm trying to come up with an iterative process to solve this and I'm really struggling!

No one said that studying computer science at 42yo would be easy 😌

=> More informations about this toot | More toots from gosha@merveilles.town

Written by gosha on 2025-01-28 at 06:30

Oooh it's dynamic programming™

=> More informations about this toot | More toots from gosha@merveilles.town

Written by gosha on 2025-01-28 at 07:03

Had to go learn to use let, iterations, and vectors to come up with that one, but it works.

=> View attached media

=> More informations about this toot | More toots from gosha@merveilles.town

Written by フェリ―ペ on 2025-01-28 at 11:22

@gosha shouldn't the iterative approach still use recursion?

=> More informations about this toot | More toots from fkinoshita@merveilles.town

Toot

Written by gosha on 2025-01-28 at 11:32

@fkinoshita I thought so too but couldn't come up with one! How did you go about it?

=> More informations about this toot | More toots from gosha@merveilles.town

Descendants

Written by フェリ―ペ on 2025-01-28 at 16:04

@gosha i also couldn't figure out for this exercise, i was hopeful you had another implementation!

=> More informations about this toot | More toots from fkinoshita@merveilles.town

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113905758723739185
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
317.135547 milliseconds
Gemini-to-HTML Time
1.76274 milliseconds

This content has been proxied by September (3851b).