applejag / typ

Generic types and functions that are missing from Go, including sets, linked lists, trees, etc.
https://pkg.go.dev/gopkg.in/typ.v4
MIT License
32 stars 2 forks source link

type: Sorted slice #6

Closed applejag closed 2 years ago

applejag commented 2 years ago

Possibly use a B-Tree as underlying data structure? Alternatively just use the AVL BST type Can't use tree as I need indexing support

applejag commented 2 years ago

I went with binary search-ed slice insertion instead. The implementation uses copy and doesn't allocate new slices on each insertion.