Returns the right child index for a given index in a binary tree. >>> s = SegmentTree([1, 2, 3]) >>> s.right(1) 3 >>> s.right(2) 5
(self, idx)
| 24 | return idx * 2 |
| 25 | |
| 26 | def right(self, idx): |
| 27 | """ |
| 28 | Returns the right child index for a given index in a binary tree. |
| 29 | |
| 30 | >>> s = SegmentTree([1, 2, 3]) |
| 31 | >>> s.right(1) |
| 32 | 3 |
| 33 | >>> s.right(2) |
| 34 | 5 |
| 35 | """ |
| 36 | return idx * 2 + 1 |
| 37 | |
| 38 | def build(self, idx, left, right): |
| 39 | if left == right: |
no outgoing calls
no test coverage detected