Skip to content

Red-black tree implementation on lua(based on ffi)

License

Notifications You must be signed in to change notification settings

qleein/lua-rbtree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

lua-rbtree

Red-black tree implementation on lua(based on ffi)

#Status test ok

#Sample

local rb = require "rbtree"

local tree, err = rb.new(1024)
if not tree then
  print("new failed:", err)
  return
end

local res, err = tree:insert("I'm key", "I'm value")
if not res then
  print("insert failed:", err)
  return
end

local res = tree:find("I'm key")
if not res or res ~= "I'm value" then
  print("find failed:")
  return
end

local res, err = tree:delete("I'm key")
if not reshen
  print("delete failed:", err)
  return
end

About

Red-black tree implementation on lua(based on ffi)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages