2min chapter

The Array Cast cover image

Fold and Scan

The Array Cast

CHAPTER

The J Fold and C Plus Plus Algorithm

The way that the J folds work is applying like a unary operation on the state, I believe, and then the binary operation. So if you're going to pack it into one fold you have to have two elements of state. You can't tack that information into a number easily. And what I was hoping with the J fold is that I could just specify like the max as one and then that binary binary operation which is, you know, a fork with,. you know, max in the middle plus and then right to get the current element. It does something close to that but not exactly what I needed.

00:00

Get the Snipd
podcast app

Unlock the knowledge in podcasts with the podcast player of the future.
App store bannerPlay store banner

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode

Save any
moment

Hear something you like? Tap your headphones to save it with AI-generated key takeaways

Share
& Export

Send highlights to Twitter, WhatsApp or export them to Notion, Readwise & more

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode