Title: Insertion Sort in PHP - Runnable Code Snippet
Open Graph Title: Insertion Sort in PHP - Runnable Code Snippet
X Title: Insertion Sort in PHP - Runnable Code Snippet
Description: Sort an array using the insertion sort algorithm by building a sorted portion one element at a time. Runnable PHP snippet with live execution.
Open Graph Description: Sort an array using the insertion sort algorithm by building a sorted portion one element at a time. Runnable PHP snippet with live execution.
X Description: Sort an array using the insertion sort algorithm by building a sorted portion one element at a time. Runnable PHP snippet with live execution.
Keywords:
Opengraph URL: https://tempercode.dev/snippets/insertion-sort-php
Domain: tempercode.dev
{"@context":"https://schema.org","@type":"SoftwareSourceCode","name":"Insertion Sort","description":"Sort an array using the insertion sort algorithm by building a sorted portion one element at a time.","programmingLanguage":"PHP","text":"for ($i = 1; $i < count($arr); $i++) {\n $key = $arr[$i];\n $j = $i - 1;\n while ($j >= 0 && $arr[$j] > $key) {\n $arr[$j + 1] = $arr[$j];\n $j--;\n }\n $arr[$j + 1] = $key;\n}\n$arr;"}
| 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