Title: Selection Sort in Ruby - Runnable Code Snippet
Open Graph Title: Selection Sort in Ruby - Runnable Code Snippet
X Title: Selection Sort in Ruby - Runnable Code Snippet
Description: Sort an array using the selection sort algorithm by repeatedly finding the minimum element. Runnable Ruby snippet with live execution.
Open Graph Description: Sort an array using the selection sort algorithm by repeatedly finding the minimum element. Runnable Ruby snippet with live execution.
X Description: Sort an array using the selection sort algorithm by repeatedly finding the minimum element. Runnable Ruby snippet with live execution.
Keywords:
Opengraph URL: https://tempercode.dev/snippets/selection-sort-ruby
Domain: tempercode.dev
{"@context":"https://schema.org","@type":"SoftwareSourceCode","name":"Selection Sort","description":"Sort an array using the selection sort algorithm by repeatedly finding the minimum element.","programmingLanguage":"Ruby","text":"a = arr.dup\n(0...a.length).each do |i|\n min_idx = i\n ((i + 1)...a.length).each do |j|\n min_idx = j if a[j] < a[min_idx]\n end\n a[i], a[min_idx] = a[min_idx], a[i]\nend\na"}
| 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