Lines Matching refs:direction
74 def jsw_single(root, direction):
75 other_side = 1 - direction
77 root[other_side] = save[direction]
78 save[direction] = root
87 def jsw_double(root, direction):
88 other_side = 1 - direction
90 return jsw_single(root, direction)
157 dir_stack = array('I') # direction stack
166 direction = 1 if key > node.key else 0
167 dir_stack.append(direction)
169 if node[direction] is None:
171 node = node[direction]
174 node[direction] = self._new_node(key, value)
179 direction = dir_stack[top]
180 other_side = 1 - direction
182 left_height = height(topnode[direction])
189 a = topnode[direction][direction]
190 b = topnode[direction][other_side]
206 left_height = height(topnode[direction])
218 dir_stack = array('I', [0] * MAXSTACK) # direction stack
229 # Push direction and node onto stack
230 direction = 1 if key > node.key else 0
231 dir_stack[top] = direction
234 node = node[direction]
240 direction = 1 if node.left is None else 0
244 node_stack[top - 1][dir_stack[top - 1]] = node[direction]
246 self._root = node[direction]
277 direction = dir_stack[top]
278 other_side = 1 - direction
280 left_height = height(topnode[direction])
291 a = topnode[other_side][direction]
294 node_stack[top] = jsw_single(topnode, direction)
296 node_stack[top] = jsw_double(topnode, direction)