deebeeayy / Queue-Bot

Discord queue bot
MIT License
0 stars 0 forks source link

Import AVL Tree Library #7

Closed deebeeayy closed 1 year ago

deebeeayy commented 1 year ago

Import the AVL tree library at https://github.com/w8r/avl for use in MFU and LFU queues. As frequency queues require sorting of the queue by both frequency and queue joining time, keeping the queue sorted on all operations will be easier than sorting on every pull from the queue.

AVL trees have O(log_2(n)) performance in search, addition, and removal operations at the expense of memory usage.

deebeeayy commented 1 year ago

Can use the ORDER BY functionality of the database to perform the sort from the table.