2024-12-24

C#のArray.BinarySarch()で見つからない場合は負の値が返ってくるけど、ドキュメントを読んでもわからん

https://onecompiler.com/csharp/433ycp238

検索対象配列:[1,3,7,20]

try to find 1

found index:0

try to find 3

found index:1

try to find 8

not found

near index:2

try to find 100

not found

near index:3

コードで書くとこういう感じになるが、これで解釈はあってる?

記事への反応(ブックマークコメント)

ログイン ユーザー登録
ようこそ ゲスト さん