示例#1
0
def rb_build():
    tree = RBTree.from_keys(keys)
示例#2
0
from __main__ import rb_build_delete, rb_build, rb_search
"""
setup_FastRBTree = """
from __main__ import crb_build_delete, crb_build, crb_search
"""

try:
    fp = open('testkeys.txt')
    keys = eval(fp.read())
    fp.close()
    bskeys = zip(keys, keys)
except IOError:
    print("create 'testkeys.txt' with profile_bintree.py\n")
    sys.exit()

py_searchtree = RBTree.from_keys(keys)
cy_searchtree = FastRBTree.from_keys(keys)


def rb_build_delete():
    tree = RBTree.from_keys(keys)
    for key in keys:
        del tree[key]


def crb_build_delete():
    tree = FastRBTree.from_keys(keys)
    for key in keys:
        del tree[key]

示例#3
0
def rb_build_delete():
    tree = RBTree.from_keys(keys)
    for key in keys:
        del tree[key]
示例#4
0
from __main__ import keys, rb_prev, rb_succ
"""
setup_FastRBTree_ps = """
from __main__ import keys, crb_prev, crb_succ
"""

try:
    fp = open('testkeys.txt')
    keys = eval(fp.read())
    fp.close()
    bskeys = zip(keys, keys)
except IOError:
    print("create 'testkeys.txt' with profile_bintree.py\n")
    sys.exit()

ptree = PTree.from_keys(keys)
ftree = FTree.from_keys(keys)


def rb_prev():
    for key in keys:
        try:
            item = ptree.prev_item(key)
        except KeyError:
            pass


def rb_succ():
    for key in keys:
        try:
            item = ptree.succ_item(key)
示例#5
0
from __main__ import keys, rb_prev, rb_succ
"""
setup_FastRBTree_ps = """
from __main__ import keys, crb_prev, crb_succ
"""

try:
    fp = open('testkeys.txt')
    keys = eval(fp.read())
    fp.close()
    bskeys = zip(keys, keys)
except IOError:
    print("create 'testkeys.txt' with profile_bintree.py\n")
    sys.exit()

ptree = PTree.from_keys(keys)
ftree = FTree.from_keys(keys)


def rb_prev():
    for key in keys:
        try:
            item = ptree.prev_item(key)
        except KeyError:
            pass


def rb_succ():
    for key in keys:
        try:
            item = ptree.succ_item(key)
def rb_build_delete():
    tree = RBTree.from_keys(keys)
    for key in keys:
        del tree[key]
def rb_build():
    tree = RBTree.from_keys(keys)
示例#8
0
from __main__ import rb_build_delete, rb_build, rb_search
"""
setup_FastRBTree = """
from __main__ import crb_build_delete, crb_build, crb_search
"""

try:
    fp = open('testkeys.txt')
    keys = eval(fp.read())
    fp.close()
    bskeys = zip(keys, keys)
except IOError:
    print("create 'testkeys.txt' with profile_bintree.py\n")
    sys.exit()

py_searchtree = RBTree.from_keys(keys)
cy_searchtree = FastRBTree.from_keys(keys)


def rb_build_delete():
    tree = RBTree.from_keys(keys)
    for key in keys:
        del tree[key]


def crb_build_delete():
    tree = FastRBTree.from_keys(keys)
    for key in keys:
        del tree[key]