Home | History | Annotate | Download | only in python2.7

Lines Matching refs:lo

3 def insort_right(a, x, lo=0, hi=None):
8 Optional args lo (default 0) and hi (default len(a)) bound the
12 if lo < 0:
13 raise ValueError('lo must be non-negative')
16 while lo < hi:
17 mid = (lo+hi)//2
19 else: lo = mid+1
20 a.insert(lo, x)
24 def bisect_right(a, x, lo=0, hi=None):
31 Optional args lo (default 0) and hi (default len(a)) bound the
35 if lo < 0:
36 raise ValueError('lo must be non-negative')
39 while lo < hi:
40 mid = (lo+hi)//2
42 else: lo = mid+1
43 return lo
47 def insort_left(a, x, lo=0, hi=None):
52 Optional args lo (default 0) and hi (default len(a)) bound the
56 if lo < 0:
57 raise ValueError('lo must be non-negative')
60 while lo < hi:
61 mid = (lo+hi)//2
62 if a[mid] < x: lo = mid+1
64 a.insert(lo, x)
67 def bisect_left(a, x, lo=0, hi=None):
74 Optional args lo (default 0) and hi (default len(a)) bound the
78 if lo < 0:
79 raise ValueError('lo must be non-negative')
82 while lo < hi:
83 mid = (lo+hi)//2
84 if a[mid] < x: lo = mid+1
86 return lo