Implement BBS algorithm with Rtree in C.