Implimentation
Add a new Script
object to ServerScriptService
in Roblox Studio.
Using Method 1:¶
Using Method 2:¶
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RedBlackDbTree = require(ReplicatedStorage.RedBlackDbTree) -- Impliment the module
Info
Method 2 assumes you've successfuly installed RedBlackDbTree into ReplicatedStorage
After using a provided method:¶
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()
When you run your game, the following should be printed to the console:
Congrats!