Home
last modified time | relevance | path

Searched refs:childpos (Results 1 – 4 of 4) sorted by relevance

/external/python/cpython2/Lib/
Dheapq.py300 childpos = 2*pos + 1 # leftmost child position
301 while childpos < endpos:
303 rightpos = childpos + 1
304 if rightpos < endpos and not cmp_lt(heap[childpos], heap[rightpos]):
305 childpos = rightpos
307 heap[pos] = heap[childpos]
308 pos = childpos
309 childpos = 2*pos + 1
336 childpos = 2*pos + 1 # leftmost child position
337 while childpos < endpos:
[all …]
/external/python/cpython3/Modules/
D_heapqmodule.c55 Py_ssize_t startpos, endpos, childpos, limit; in siftup() local
72 childpos = 2*pos + 1; /* leftmost child position */ in siftup()
73 if (childpos + 1 < endpos) { in siftup()
75 arr[childpos], in siftup()
76 arr[childpos + 1], in siftup()
80 childpos += ((unsigned)cmp ^ 1); /* increment when cmp==0 */ in siftup()
89 tmp1 = arr[childpos]; in siftup()
91 arr[childpos] = tmp2; in siftup()
93 pos = childpos; in siftup()
409 Py_ssize_t startpos, endpos, childpos, limit; in siftup_max() local
[all …]
/external/python/cpython3/Lib/
Dheapq.py263 childpos = 2*pos + 1 # leftmost child position
264 while childpos < endpos:
266 rightpos = childpos + 1
267 if rightpos < endpos and not heap[childpos] < heap[rightpos]:
268 childpos = rightpos
270 heap[pos] = heap[childpos]
271 pos = childpos
272 childpos = 2*pos + 1
299 childpos = 2*pos + 1 # leftmost child position
300 while childpos < endpos:
[all …]
/external/python/cpython2/Modules/
D_heapqmodule.c77 Py_ssize_t startpos, endpos, childpos, rightpos, limit; in _siftup() local
93 childpos = 2*pos + 1; /* leftmost child position */ in _siftup()
94 rightpos = childpos + 1; in _siftup()
97 PyList_GET_ITEM(heap, childpos), in _siftup()
102 childpos = rightpos; in _siftup()
110 tmp1 = PyList_GET_ITEM(heap, childpos); in _siftup()
112 PyList_SET_ITEM(heap, childpos, tmp2); in _siftup()
114 pos = childpos; in _siftup()
418 Py_ssize_t startpos, endpos, childpos, rightpos, limit; in _siftupmax() local
436 childpos = 2*pos + 1; /* leftmost child position */ in _siftupmax()
[all …]