Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我可以在这里找到一个 C++ 的,但没有纯 C 的。任何指针?
红黑树的 C 代码,获得了非常慷慨的MIT 许可证。
(在 archive.org 上备份。)
如果将数据限制为不重叠的段,则可以使用<search.h> tsearch/tfind等二叉树函数,其中使用整数区间元组作为键。提供的比较函数可以轻松地对段进行总排序。tfind为宽度为 0 的合成区间查找包含给定点的段。
<search.h>
tsearch
tfind