8000 GitHub - jgm-ktg/rangedict: python range dict · GitHub
[go: up one dir, main page]

Skip to content
jgm-ktgPublic
forked from WKPlus/rangedict

About

python range dict

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

24 Commits

Folders and files

Repository files navigation

#rangedict Build Status Coverage Status

rangedict is a dict whose key can be a range.

##Usage

    >>> from rangedict import RangeDict
    >>> rd = RangeDict()
    >>> rd[(1, 2)] = 1
    >>> rd[(3, 3)] = 3
    >>> rd[(5, 7)] = 5
    >>> print rd[6]
    5
    >>> 3 in rd
    True
    >>> del rd[(3, 3)]
    >>> 3 in rd
    False

Implemented based on red black tree provides an O(logn) complexity for inserting, deleting and finding.

##Installation Installation with pip is recommended:

pip install rangedict

About

python range dict

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0