sc icon indicating copy to clipboard operation
sc copied to clipboard

Any plans on implementing AVL tree?

Open germaniuss opened this issue 3 years ago • 7 comments

I was in need of a simple string map data structure that would be alphabetically sorted, however the only map implementation in here is a simple hash map. I was wondering if there are any plans to implement an ordered map in the form of an AVL tree? I ended up using another random implementation I found on github though I would've loved to use this library since it's awesome and I use it for everything else.

germaniuss avatar Aug 05 '22 23:08 germaniuss

I agree a tree implementation is missing in the toolset :)

Currently, there is no plan for it. There is a bplus tree which I couldn't publish due to licensing but I was told that I can open source it after 2022. So, I guess, I'll add it by the end of this year. Not sure if it helps you though.

tezc avatar Aug 09 '22 08:08 tezc

Well for now I'll use the other tree implementation I found. On another note is there anything in the library that can be used as a shared semaphore between processes. Kind of like semaphore.h on POSIX systems.

germaniuss avatar Aug 10 '22 10:08 germaniuss

Sorry, there is nothing for inter-process communication.

tezc avatar Aug 10 '22 12:08 tezc

That's fine I might just change the mutex implementation a little and use the mmap to store it. Thanks for your time anyways!

germaniuss avatar Aug 10 '22 14:08 germaniuss

Here you can find a non-recursive implementation of the AVL Tree that is well done and simple to adapt to your needs.

https://github.com/xieqing/avl-tree

iz0eyj avatar Oct 23 '22 09:10 iz0eyj