Skip to main content

Tag: concurrency

Iterating Over A Trie With Channels And Goroutines

We have a trie that stores set of integer slices. We want an iterator over its items. What we do here is have one goroutine to walk over the trie and send the items over channel. Other goroutine pulls the items from the channel and prints them out. My mental image of this is one gopher jumping around a tree and throwing mangoes back at his friend on the ground.