1. 程式人生 > >python list查詢及所需時間

python list查詢及所需時間

python list查詢及所需時間


time
cost_time(fun):
    cost(*args,**kwargs):
        stime = time.time()
        x = fun(*args,**kwargs)
        etime = time.time()
        ,fun.,etime-stime
        x
    cost
list_query(_list,_val):
    low = height = (i) - mid = (height - low) // n (height+):
        _list[n] == _val:
            n
    n (mid,height+):
        _list[n] == _val:
            n
__name__ == :
    i = ()
    subscript = list_query(i,)
    subscript


python list查詢及所需時間