Skip to content

Commit 9cc02bb

Browse files
authored
feat : added new og image to the metadata
Merge pull request #19 from Sohan-Rout/main1
2 parents 983e2e2 + 270b146 commit 9cc02bb

File tree

3 files changed

+10
-67
lines changed

3 files changed

+10
-67
lines changed

app/visualizer/sorting/insertionsort/page.jsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@ export const metadata = {
3737
"Insertion Sort Code Examples",
3838
],
3939
robots: "index, follow",
40+
openGraph: {
41+
images: [
42+
{
43+
url: "/og/sorting/insertionSort.png",
44+
width: 1200,
45+
height: 630,
46+
alt: "Insertion Sort Algorithm Visualization",
47+
},
48+
],
49+
},
4050
};
4151

4252
export default function Page() {

app/visualizer/sorting/mergesort/content.jsx

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,6 @@ const content = () => {
66
`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.`,
77
];
88

9-
const divide = [
10-
{ points : "Split the array into two halves: [38, 27, 43] and [3, 9, 82, 10]" },
11-
{ points : "Recursively split each half until single elements remain" },
12-
];
13-
14-
const merge = [
15-
{ points : "Merge single elements into sorted pairs: [27, 38], [3, 43], [9, 82], [10]" },
16-
{ points : "Merge pairs: [3, 27, 38, 43] and [9, 10, 82]" },
17-
{ points : "Final merge: [3, 9, 10, 27, 38, 43, 82]" },
18-
];
19-
209
const algorithm = [
2110
{ points : "Divide:",
2211
subpoints : [
@@ -69,62 +58,6 @@ const content = () => {
6958
</div>
7059
</section>
7160

72-
{/* How Does It Work */}
73-
<section className="p-6 border-b border-gray-100 dark:border-gray-700">
74-
<h1 className="text-2xl font-bold text-gray-900 dark:text-white mb-4 flex items-center">
75-
<span className="w-1 h-6 bg-blue-500 mr-3 rounded-full"></span>
76-
How Does It Work?
77-
</h1>
78-
<div className="prose dark:prose-invert max-w-none">
79-
<p className="text-gray-700 dark:text-gray-300 mb-4 leading-relaxed">
80-
Consider this unsorted array: [38, 27, 43, 3, 9, 82, 10]
81-
</p>
82-
83-
<div className="space-y-4">
84-
<div>
85-
<span className="font-semibold text-gray-900 dark:text-white">Divide Phase:</span>
86-
<ol className="mt-2 space-y-2 list-decimal pl-5 marker:text-gray-500 dark:marker:text-gray-400">
87-
{divide.map((item, index) => (
88-
<li key={index} className="text-gray-700 dark:text-gray-300 pl-2">
89-
{item.points}
90-
</li>
91-
))}
92-
</ol>
93-
</div>
94-
95-
<div>
96-
<span className="font-semibold text-gray-900 dark:text-white">Merge Phase:</span>
97-
<ol className="mt-2 space-y-2 list-decimal pl-5 marker:text-gray-500 dark:marker:text-gray-400">
98-
{merge.map((item, index) => (
99-
<li key={index} className="text-gray-700 dark:text-gray-300 pl-2">
100-
{item.points}
101-
</li>
102-
))}
103-
</ol>
104-
</div>
105-
106-
<div className="mt-4 p-4 bg-gray-100 dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-700">
107-
<pre className="text-sm font-mono text-gray-800 dark:text-gray-300 overflow-x-auto">
108-
{`Original:
109-
[38, 27, 43, 3, 9, 82, 10]
110-
Divide:
111-
[38,27,43][3,9,82,10]
112-
Divide:
113-
[38][27,43] | [3,9][82,10]
114-
Divide:
115-
[38][27][43] | [3][9][82][10]
116-
Merge:
117-
[27,38][43] | [3,9][10,82]
118-
Merge:
119-
[27,38,43] | [3,9,10,82]
120-
Final:
121-
[3,9,10,27,38,43,82]`}
122-
</pre>
123-
</div>
124-
</div>
125-
</div>
126-
</section>
127-
12861
{/* Algorithm Steps */}
12962
<section className="p-6 border-b border-gray-100 dark:border-gray-700">
13063
<h1 className="text-2xl font-bold text-gray-900 dark:text-white mb-4 flex items-center">
130 KB
Loading

0 commit comments

Comments
 (0)