heap helper function get the position of the parent of the current node >>> get_parent_position(1) 0 >>> get_parent_position(2) 0
(position: int)
| 16 | |
| 17 | |
| 18 | def get_parent_position(position: int) -> int: |
| 19 | """ |
| 20 | heap helper function get the position of the parent of the current node |
| 21 | |
| 22 | >>> get_parent_position(1) |
| 23 | 0 |
| 24 | >>> get_parent_position(2) |
| 25 | 0 |
| 26 | """ |
| 27 | return (position - 1) // 2 |
| 28 | |
| 29 | |
| 30 | def get_child_left_position(position: int) -> int: |
no outgoing calls
no test coverage detected