1 - startpos = 0, 2 - endpos = len(searchlist) -1, 3 - while (startpos<= endpos):, 4 - mid = (startpos + endpos) / 2, 5 - if searchlist[mid] == goal:, 6 - print(mid), 7 - elif searchlist[mid] < goal:, 8 - startpos = mid + 1, 9 - else:, 10 - endpos = mid - 1, 11 - print ( "-1"),

リーダーボード

表示スタイル

オプション

テンプレートを切り替える

自動保存: を復元しますか?