Blog Post: How I turned a binary search tree into a generic data structure with go2go

Hi everyone,

As you surely know, generic data types and functions are on their way into one of the next Go releases.

When the generics proposal came out, and the go2go transpiler and playground along with it, many articles have been written about the new language feature, and how to create generic data types or functions.

Recently, I had a different thought: How about transforming existing code into generic one?

So I took a container data type – a balanced search tree – from one of my older blog articles, and turned it into a generic search tree. After all, how difficult can this be?

I posted my journey and the results in a new blog post: appliedgo.net/generictree

Enjoy & let me know your thoughts!

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.