René's URL Explorer Experiment


Title: Heap Sort in JavaScript - Runnable Code Snippet

Open Graph Title: Heap Sort in JavaScript - Runnable Code Snippet

X Title: Heap Sort in JavaScript - Runnable Code Snippet

Description: Sort an array using the heap sort algorithm with O(n log n) time complexity. Runnable JavaScript snippet with live execution.

Open Graph Description: Sort an array using the heap sort algorithm with O(n log n) time complexity. Runnable JavaScript snippet with live execution.

X Description: Sort an array using the heap sort algorithm with O(n log n) time complexity. Runnable JavaScript snippet with live execution.

Keywords:

Opengraph URL: https://tempercode.dev/snippets/heap-sort-javascript

direct link

Domain: tempercode.dev


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"SoftwareSourceCode","name":"Heap Sort","description":"Sort an array using the heap sort algorithm with O(n log n) time complexity.","programmingLanguage":"JavaScript","text":"const a = [...arr];\nconst heapify = (n, i) => {\n  let largest = i, l = 2 * i + 1, r = 2 * i + 2;\n  if (l < n && a[l] > a[largest]) largest = l;\n  if (r < n && a[r] > a[largest]) largest = r;\n  if (largest !== i) { [a[i], a[largest]] = [a[largest], a[i]]; heapify(n, largest); }\n};\nfor (let i = Math.floor(a.length / 2) - 1; i >= 0; i--) heapify(a.length, i);\nfor (let i = a.length - 1; i > 0; i--) { [a[0], a[i]] = [a[i], a[0]]; heapify(i, 0); }\nreturn a;"}

theme-color#0c0d12
color-schemedark
authorTemper
creatorTemper
publisherTemper
og:imagehttps://tempercode.dev/og-image.png
og:typearticle
twitter:cardsummary_large_image
twitter:imagehttps://tempercode.dev/og-image.png

Links:

Temperhttps://tempercode.dev/snippets
Snippetshttps://tempercode.dev/snippets
Editorhttps://tempercode.dev/editor
CLIhttps://tempercode.dev/cli
https://github.com/handcraftbyte/temper-snippets
Snippetshttps://tempercode.dev/snippets
Editorhttps://tempercode.dev/editor
CLIhttps://tempercode.dev/cli
https://github.com/handcraftbyte/temper-snippets/blob/main/algorithms/heap-sort-javascript.md
Pythonhttps://tempercode.dev/snippets/heap-sort-python
Rubyhttps://tempercode.dev/snippets/heap-sort-ruby
PHPhttps://tempercode.dev/snippets/heap-sort-php
Bashhttps://tempercode.dev/snippets/heap-sort-bash
Bubble SortSort an array using the bubble sort algorithm by repeatedly swapping adjacent elements.https://tempercode.dev/snippets/bubble-sort-javascript
Counting SortSort an array of non-negative integers using counting sort for linear time performance.https://tempercode.dev/snippets/counting-sort-javascript
Insertion SortSort an array using the insertion sort algorithm by building a sorted portion one element at a time.https://tempercode.dev/snippets/insertion-sort-javascript
Merge SortSort an array using the merge sort algorithm with O(n log n) time complexity.https://tempercode.dev/snippets/merge-sort-javascript
QuicksortSort an array using the quicksort algorithm with average O(n log n) time complexity.https://tempercode.dev/snippets/quicksort-javascript
Selection SortSort an array using the selection sort algorithm by repeatedly finding the minimum element.https://tempercode.dev/snippets/selection-sort-javascript

Viewport: width=device-width, initial-scale=1


URLs of crawlers that visited me.