Skip to content

xiangnanscu/c_data_structures

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

c_data_structures

Frequently-used dynamic data structures written in C.
Test data file download link: http://pan.baidu.com/s/18fpnC
Test: Such as in Windows, Compile xlib.exe, and type "xlib < words > result.txt"
To do list: list.c, set.c and communication between list, set and dict.

  1. dict.c
    By default, the memory pointed by pointer value or key of PyDictEntry must be free directly, or you have to provide custom free functions. They are passed at the last two arguments in dict_cnew.
    Just pass key or value's buffer to functions (such as dict_set, dict_get, dict_fget), they know how to handle memory management.

  2. rbtree.c
    Red black tree data structure. Functions or memory management are almost the same as dict, but rbtree store keys in order, so it is prefered when keys' order matters.

    3.set.c
    The hash algorithms is the same as dict.c. set offers basic operations between two sets, i.e. issubset, issuperset, intersection, difference, union and symmetric difference. Also there are key level functions:add, del and has. They are very fast.

About

Frequently-used dynamic data structures written in C.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published