A declarative Red Black Tree Module for Roblox Lua.
Please note: This is my first in-depth GitHub and is a work in progress.
- Inside your script, you can
require
the module directly.
-
Download the rbxm model file from the RedBlackDbTree GitHub
-
Insert the model into Roblox Studio in a place like
ReplicatedStorage
For a more detailed guide and examples, visit the official RedBlackDbTree documentation.
local RedBlackDbTree = require(11328824364) -- Impliment the module
local tree = RedBlackDbTree.new() -- Instantiate the tree
tree:AddAll(5,6,8,9,2,1,4,109) -- Add objects into the tree
tree:AddAll({3,7}) -- We can alternatively add objects like this
tree:Remove(109) -- Remove an object
tree:InOrderPrint()
RedBlackDbTree is available under the Apache 2.0 License. See LICENSE.md for details.