diff --git a/app/visualizer/sorting/insertionsort/page.jsx b/app/visualizer/sorting/insertionsort/page.jsx index 301e2ec..9d13021 100644 --- a/app/visualizer/sorting/insertionsort/page.jsx +++ b/app/visualizer/sorting/insertionsort/page.jsx @@ -37,6 +37,16 @@ export const metadata = { "Insertion Sort Code Examples", ], robots: "index, follow", + openGraph: { + images: [ + { + url: "/og/sorting/insertionSort.png", + width: 1200, + height: 630, + alt: "Insertion Sort Algorithm Visualization", + }, + ], + }, }; export default function Page() { diff --git a/app/visualizer/sorting/mergesort/content.jsx b/app/visualizer/sorting/mergesort/content.jsx index e0037ee..ef15f62 100644 --- a/app/visualizer/sorting/mergesort/content.jsx +++ b/app/visualizer/sorting/mergesort/content.jsx @@ -6,17 +6,6 @@ const content = () => { `Merge Sort is particularly useful when sorting linked lists (where random access is expensive) and is the algorithm of choice for many standard library sorting implementations when stability is required. It's also commonly used in external sorting where data doesn't fit in memory.`, ]; - const divide = [ - { points : "Split the array into two halves: [38, 27, 43] and [3, 9, 82, 10]" }, - { points : "Recursively split each half until single elements remain" }, - ]; - - const merge = [ - { points : "Merge single elements into sorted pairs: [27, 38], [3, 43], [9, 82], [10]" }, - { points : "Merge pairs: [3, 27, 38, 43] and [9, 10, 82]" }, - { points : "Final merge: [3, 9, 10, 27, 38, 43, 82]" }, - ]; - const algorithm = [ { points : "Divide:", subpoints : [ @@ -69,62 +58,6 @@ const content = () => { - {/* How Does It Work */} -
-

- - How Does It Work? -

-
-

- Consider this unsorted array: [38, 27, 43, 3, 9, 82, 10] -

- -
-
- Divide Phase: -
    - {divide.map((item, index) => ( -
  1. - {item.points} -
  2. - ))} -
-
- -
- Merge Phase: -
    - {merge.map((item, index) => ( -
  1. - {item.points} -
  2. - ))} -
-
- -
-
-              {`Original: 
-[38, 27, 43, 3, 9, 82, 10]
-Divide:   
-[38,27,43][3,9,82,10]
-Divide:   
-[38][27,43] | [3,9][82,10]
-Divide:   
-[38][27][43] | [3][9][82][10]
-Merge:    
-[27,38][43] | [3,9][10,82]
-Merge:    
-[27,38,43] | [3,9,10,82]
-Final:    
-[3,9,10,27,38,43,82]`}
-            
-
-
-
-
- {/* Algorithm Steps */}

diff --git a/public/og/sorting/insertionSort.png b/public/og/sorting/insertionSort.png new file mode 100644 index 0000000..bf6b7e1 Binary files /dev/null and b/public/og/sorting/insertionSort.png differ