Unhandled Edge Case in Binary Search Implementation
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 25/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- javascript
- 領域
- data
調査の方向性
The issue does not identify a file or test; first locate the binary search implementation in the JavaScript codebase and reproduce the search with sorted arrays containing duplicate targets. Done means the implementation reliably returns a valid index for a target that appears multiple times, with a regression test covering that case.
索引モデルが issue の本文から書いたものです。
説明
The current implementation of the binary search algorithm in the JavaScript codebase does not handle a specific edge case where the target element is present multiple times in the sorted array. This issue is reported to address the potential misbehavior and propose a solution to handle scenarios where the binary search encounters duplicate elements.
Steps to Reproduce:
- Input a sorted array containing duplicate elements.
- Perform a binary search for a target element present multiple times in the array.
- Observe the behavior when the target element is found.
Expected Behavior:
The binary search algorithm should reliably locate and return any occurrence of the target element in the sorted array, providing accurate indices for all instances.
Current Behavior:
The current implementation may not consistently handle scenarios where duplicate elements exist in the sorted array, leading to unpredictable results when searching for the target element.
- 主要言語
- JavaScript
- スター
- 197k
- フォーク
- 31k
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
trekhleb/javascript-algorithms のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
trekhleb/javascript-algorithms#2225 ·
-
BinarySearchTreeNode removing対応中かも @bbonch が 243 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
trekhleb/javascript-algorithms#2102 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
trekhleb/javascript-algorithms#2221 · コメント 4 件 ·
-
zh-TW translations missing — should contributors help complete?対応中かも @anees4500 が 334 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
trekhleb/javascript-algorithms#2085 · コメント 6 件 · リアクション 1 件 ·
-
LinkedList methods.オープン
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
trekhleb/javascript-algorithms#2065 · コメント 1 件 ·
trekhleb/javascript-algorithms の issue をすべて見る
似ている issue
-
agent/scanner bug hive/hosted-available-lke648397-260827-5n31
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
rescript-lang/rescript#8765 ·
メンテナーはふだん 1 日以内に返信
-
feedback simulation workshop
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
githubnext/gh-aw-workshop#4417 ·
メンテナーはふだん 1 日以内に返信
-
[Good First Issue]: Add unit tests for NetworkVersionInfo対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンGood First Issue hacktoberfest
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
hiero-ledger/hiero-sdk-js#4489 ·
メンテナーはふだん 1 日以内に返信
-
Add: RiC Feedオープンcheck:passed feeds:add
難易度 1/5 1時間未満 初心者へのやさしさ 74/100
メンテナーはふだん 9 日以内に返信