|
1 | 1 | "use client"; |
2 | 2 | import React, { useState, useRef, useEffect } from "react"; |
3 | 3 | import { gsap } from "gsap"; |
4 | | -import Footer from "@/app/components/footer"; |
5 | | -import Content from "@/app/visualizer/sorting/mergesort/content"; |
6 | 4 | import ArrayGenerator from "@/app/components/ui/randomArray"; |
7 | 5 | import CustomArrayInput from "@/app/components/ui/customArrayInput"; |
8 | | -import ExploreOther from "@/app/components/ui/exploreOther"; |
9 | | -import CodeBlock from "@/app/visualizer/sorting/mergesort/codeBlock"; |
10 | | -import Quiz from "@/app/visualizer/sorting/mergesort/quiz"; |
11 | | -import GoBackButton from "@/app/components/ui/goback"; |
12 | | -import BackToTop from "@/app/components/ui/backtotop"; |
13 | 6 |
|
14 | 7 | const MergeSortVisualizer = () => { |
15 | 8 | const [array, setArray] = useState([]); |
@@ -228,20 +221,7 @@ const MergeSortVisualizer = () => { |
228 | 221 |
|
229 | 222 |
|
230 | 223 | return ( |
231 | | - <div className="min-h-screen max-h-auto bg-gray-100 dark:bg-zinc-950 text-gray-800 dark:text-gray-200"> |
232 | | - <main className="container mx-auto px-6 pt-16 pb-4"> |
233 | | - |
234 | | - { /* go back block here */} |
235 | | - <div className="mt-10 sm:mt-10"> |
236 | | - <GoBackButton /> |
237 | | - </div> |
238 | | - |
239 | | - { /* main logic here */} |
240 | | - <h1 className="text-4xl md:text-4xl mt-6 ml-10 font-bold text-left text-gray-900 dark:text-white mb-0"> |
241 | | - <span className="text-black dark:text-white">Merge Sort</span> |
242 | | - </h1> |
243 | | - <div className='bg-black border border-none dark:bg-gray-600 w-100 h-[2px] rounded-xl mt-2 mb-5'></div> |
244 | | - <Content /> |
| 224 | + <main className="container mx-auto px-6 pt-2 pb-6"> |
245 | 225 | <p className="text-lg text-center text-gray-600 dark:text-gray-400 mb-8"> |
246 | 226 | Visualize the divide-and-conquer approach of Merge Sort with recursive |
247 | 227 | splitting and merging. |
@@ -364,57 +344,8 @@ const MergeSortVisualizer = () => { |
364 | 344 | </div> |
365 | 345 | )} |
366 | 346 | </div> |
367 | | - |
368 | | - {/* Enhanced Recursion Tree */} |
369 | | - |
370 | | - {/* Algorithm Explanation with Visual Guide */} |
371 | | - <div className="bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md border border-gray-200 dark:border-gray-700 mt-8"> |
372 | | - <h2 className="text-xl font-semibold mb-4">Merge Sort Process</h2> |
373 | | - <div> |
374 | | - <div> |
375 | | - <h3 className="font-medium mb-2">Steps:</h3> |
376 | | - <ol className="list-decimal pl-5 space-y-2"> |
377 | | - <li> |
378 | | - Divide array into halves recursively until single elements |
379 | | - </li> |
380 | | - <li>Merge adjacent subarrays in sorted order</li> |
381 | | - <li>Continue merging until whole array is sorted</li> |
382 | | - </ol> |
383 | | - </div> |
384 | | - </div> |
385 | | - </div> |
386 | 347 | </div> |
387 | | - |
388 | | - { /* quiz block here */} |
389 | | - <p className="text-lg text-center text-gray-600 dark:text-gray-400 mt-8 mb-8"> |
390 | | - Test Your Knowledge before moving forward! |
391 | | - </p> |
392 | | - <Quiz /> |
393 | | - |
394 | | - <CodeBlock /> |
395 | | - <ExploreOther |
396 | | - title="Explore Sorting Algorithms" |
397 | | - links={[ |
398 | | - { |
399 | | - text: "Selection Sort", |
400 | | - url: "/visualizer/sorting/selectionsort", |
401 | | - }, |
402 | | - { text: "Bubble Sort", url: "/visualizer/sorting/bubblesort" }, |
403 | | - { |
404 | | - text: "Insertion Sort", |
405 | | - url: "/visualizer/sorting/insertionsort", |
406 | | - }, |
407 | | - { text: "Quick Sort", url: "/visualizer/sorting/quicksort" }, |
408 | | - { text: "Heap Sort", url: "/algorithms/sorting/heap" }, |
409 | | - ]} |
410 | | - /> |
411 | 348 | </main> |
412 | | - <div> |
413 | | - <div className="bg-gray-700 z-10 h-[1px]"></div> |
414 | | - </div> |
415 | | - <BackToTop/> |
416 | | - <Footer /> |
417 | | - </div> |
418 | 349 | ); |
419 | 350 | }; |
420 | 351 |
|
|
0 commit comments