You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
932 B

  1. # cython: language_level=2
  2. cdef class RBNode:
  3. cdef public object obj
  4. cdef public double start, end
  5. cdef public int red
  6. cdef public RBNode left, right, parent
  7. cdef class RBTree:
  8. cdef public RBNode nil, root
  9. cpdef getroot(RBTree self)
  10. cdef void __rotate_left(RBTree self, RBNode x)
  11. cdef void __rotate_right(RBTree self, RBNode y)
  12. cdef RBNode __successor(RBTree self, RBNode x)
  13. cpdef RBNode successor(RBTree self, RBNode x)
  14. cdef RBNode __predecessor(RBTree self, RBNode x)
  15. cpdef RBNode predecessor(RBTree self, RBNode x)
  16. cpdef insert(RBTree self, RBNode z)
  17. cdef void __insert_fixup(RBTree self, RBNode x)
  18. cpdef delete(RBTree self, RBNode z)
  19. cdef inline void __delete_fixup(RBTree self, RBNode x)
  20. cpdef RBNode find(RBTree self, double start, double end)
  21. cpdef RBNode find_left_end(RBTree self, double t)
  22. cpdef RBNode find_right_start(RBTree self, double t)