开发者

C implementation of an interval tree?

开发者 https://www.devze.com 2023-01-24 04:08 出处:网络
I could find a C++ one here, but no pure C one. Any pointer开发者_如何学运维s?C code for a red and black tree, licensed with the very generous MIT license.

I could find a C++ one here, but no pure C one. Any pointer开发者_如何学运维s?


C code for a red and black tree, licensed with the very generous MIT license.

(Backup at archive.org.)


If you limit the data to nonoverlapping segments, you can use the <search.h> tsearch/tfind etc. binary-tree functions, whereby you use the integer interval tuples as keys. A supplied comparison function would easily put a total-order on segments. To find a segment that includes a given point, tfind for a synthetic interval of width 0.

0

精彩评论

暂无评论...
验证码 换一张
取 消