Title: Binary Search in Bash - Runnable Code Snippet
Open Graph Title: Binary Search in Bash - Runnable Code Snippet
X Title: Binary Search in Bash - Runnable Code Snippet
Description: Find the index of an element in a sorted array using binary search with O(log n) time complexity. Runnable Bash snippet with live execution.
Open Graph Description: Find the index of an element in a sorted array using binary search with O(log n) time complexity. Runnable Bash snippet with live execution.
X Description: Find the index of an element in a sorted array using binary search with O(log n) time complexity. Runnable Bash snippet with live execution.
Keywords:
Opengraph URL: https://tempercode.dev/snippets/binary-search-bash
Domain: tempercode.dev
{"@context":"https://schema.org","@type":"SoftwareSourceCode","name":"Binary Search","description":"Find the index of an element in a sorted array using binary search with O(log n) time complexity.","programmingLanguage":"Bash","text":"echo \"$arr\" | jq --argjson t \"$target\" 'to_entries | map(select(.value == $t)) | if length > 0 then .[0].key else -1 end'"}
| theme-color | #0c0d12 |
| color-scheme | dark |
| author | Temper |
| creator | Temper |
| publisher | Temper |
| og:image | https://tempercode.dev/og-image.png |
| og:type | article |
| twitter:card | summary_large_image |
| twitter:image | https://tempercode.dev/og-image.png |
Links:
Viewport: width=device-width, initial-scale=1