Return a pair (index, pos), indicating the next occurrence of char in str. index is the position of the character considering only ordinals up to and including char, and pos is the position in the full string. index/pos is the starting position in the full string.
(str, char, index, pos)
| 28 | return res |
| 29 | |
| 30 | def selective_find(str, char, index, pos): |
| 31 | """Return a pair (index, pos), indicating the next occurrence of |
| 32 | char in str. index is the position of the character considering |
| 33 | only ordinals up to and including char, and pos is the position in |
| 34 | the full string. index/pos is the starting position in the full |
| 35 | string.""" |
| 36 | |
| 37 | l = len(str) |
| 38 | while 1: |
| 39 | pos += 1 |
| 40 | if pos == l: |
| 41 | return (-1, -1) |
| 42 | c = str[pos] |
| 43 | if c == char: |
| 44 | return index+1, pos |
| 45 | elif c < char: |
| 46 | index += 1 |
| 47 | |
| 48 | def insertion_unsort(str, extended): |
| 49 | """3.2 Insertion unsort coding""" |
no outgoing calls
no test coverage detected
searching dependent graphs…