-
Notifications
You must be signed in to change notification settings - Fork 61
docs: add comprehensive educational content for algorithm design and analysis #107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Aarush-Pradhan
wants to merge
5
commits into
pushkarscripts:main
Choose a base branch
from
Aarush-Pradhan:docs/openCSE-documentation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
34dadf2
docs: add comprehensive educational content for algorithm design and …
Aarush-Pradhan 23a3f57
Resolve merge conflict in sidebar
Aarush-Pradhan c0f0d8d
Resolve sidebar merge conflict
Aarush-Pradhan 0b6afaf
Remove sidebar.tsx changes from PR
Aarush-Pradhan 8df877f
chore: force reset sidebar to match upstream main
Aarush-Pradhan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,199 @@ | ||
| import Link from "next/link"; | ||
|
|
||
| import { Ch0Content } from "../content/chapter0"; | ||
| import { Ch1Content } from "../content/chapter1"; | ||
| import { Ch2Content } from "../content/chapter2"; | ||
| import { Ch3Content } from "../content/chapter3"; | ||
| import { Ch4Content } from "../content/chapter4"; | ||
| import { Ch5Content } from "../content/chapter5"; | ||
| import { Ch6Content } from "../content/chapter6"; | ||
| import { Ch7Content } from "../content/chapter7"; | ||
| import { Ch8Content } from "../content/chapter8"; | ||
|
|
||
| import { ArrowBigLeft, ArrowBigRight } from "lucide-react"; | ||
| import { Righteous } from "next/font/google"; | ||
|
|
||
| const righteous = Righteous({ | ||
| subsets: ["latin"], | ||
| weight: "400", | ||
| variable: "--font-righteous", | ||
| }); | ||
|
|
||
| const chapters = [ | ||
| { | ||
| id: "ch0", | ||
| title: "Course Outline", | ||
| component: Ch0Content, | ||
| }, | ||
|
|
||
| { | ||
| id: "ch1", | ||
| title: "Introduction to Algorithms", | ||
| component: Ch1Content, | ||
| }, | ||
|
|
||
| { | ||
| id: "ch2", | ||
| title: "Time and Space Complexity", | ||
| component: Ch2Content, | ||
| }, | ||
|
|
||
| { | ||
| id: "ch3", | ||
| title: "Searching and Sorting Algorithms", | ||
| component: Ch3Content, | ||
| }, | ||
|
|
||
| { | ||
| id: "ch4", | ||
| title: "Divide and Conquer Technique", | ||
| component: Ch4Content, | ||
| }, | ||
|
|
||
| { | ||
| id: "ch5", | ||
| title: "Greedy Method", | ||
| component: Ch5Content, | ||
| }, | ||
|
|
||
| { | ||
| id: "ch6", | ||
| title: "Dynamic Programming", | ||
| component: Ch6Content, | ||
| }, | ||
|
|
||
| { | ||
| id: "ch7", | ||
| title: "Graph Algorithms", | ||
| component: Ch7Content, | ||
| }, | ||
|
|
||
| { | ||
| id: "ch8", | ||
| title: "Backtracking and Branch & Bound", | ||
| component: Ch8Content, | ||
| }, | ||
| ]; | ||
|
|
||
| type ChapterProps = { | ||
| params: { chapter: string }; | ||
| }; | ||
|
|
||
| export default function ChapterPage({ params }: ChapterProps) { | ||
|
|
||
| const currentIndex = chapters.findIndex( | ||
| (c) => c.id === params.chapter | ||
| ); | ||
|
|
||
| const chapter = chapters[currentIndex]; | ||
|
|
||
| if (!chapter) { | ||
| return ( | ||
| <h1 className="text-2xl font-bold text-[#e2d1c1]"> | ||
| Chapter not found | ||
| </h1> | ||
| ); | ||
| } | ||
|
|
||
| const ChapterComponent = chapter.component; | ||
|
|
||
| const prevChapter = | ||
| currentIndex > 0 | ||
| ? chapters[currentIndex - 1] | ||
| : null; | ||
|
|
||
| const nextChapter = | ||
| currentIndex < chapters.length - 1 | ||
| ? chapters[currentIndex + 1] | ||
| : null; | ||
|
|
||
| return ( | ||
| <div className="flex flex-col bg-[#1B0D00] min-h-full p-3 pt-6 text-[#e2d1c1]"> | ||
|
|
||
| {/* Main Content */} | ||
| <div className="flex-1"> | ||
|
|
||
| <h1 | ||
| className={`text-4xl md:text-5xl font-bold mb-3 ${righteous.className}`} | ||
| > | ||
| Algorithm Design and Analysis | ||
| </h1> | ||
|
|
||
| <p | ||
| className={`text-2xl md:text-3xl ${righteous.className}`} | ||
| > | ||
| {chapter.title} | ||
| </p> | ||
|
|
||
| {/* Top Navigation */} | ||
| <div className="flex justify-between mt-5 gap-4 flex-wrap"> | ||
|
|
||
| {prevChapter ? ( | ||
| <Link | ||
| href={`/sem5/ada2/${prevChapter.id}`} | ||
| className="px-4 py-2 text-xl flex items-center justify-center bg-[#e2d1c1] text-[#1b0d00] rounded-lg hover:bg-[#ac9e91] transition" | ||
| style={{ fontFamily: "Rockwell, serif" }} | ||
| > | ||
| <ArrowBigLeft className="inline-block mr-1" /> | ||
| Previous | ||
| </Link> | ||
| ) : ( | ||
| <div /> | ||
| )} | ||
|
|
||
| {nextChapter ? ( | ||
| <Link | ||
| href={`/sem5/ada2/${nextChapter.id}`} | ||
| className="px-4 py-2 text-xl flex items-center justify-center bg-[#e2d1c1] text-[#1b0d00] rounded-lg hover:bg-[#ac9e91] transition" | ||
| style={{ fontFamily: "Rockwell, serif" }} | ||
| > | ||
| Next | ||
| <ArrowBigRight className="inline-block ml-1" /> | ||
| </Link> | ||
| ) : ( | ||
| <div /> | ||
| )} | ||
|
|
||
| </div> | ||
|
|
||
| <hr className="my-6 border-[#c7a669] opacity-40" /> | ||
|
|
||
| <ChapterComponent /> | ||
|
|
||
| </div> | ||
|
|
||
| {/* Bottom Navigation */} | ||
| <div className="flex justify-between gap-4 my-8 flex-wrap"> | ||
|
|
||
| {prevChapter ? ( | ||
|
|
||
| <Link | ||
| href={`/sem5/ada2/${prevChapter.id}`} | ||
| className="px-4 py-2 bg-[#e2d1c1] text-lg md:text-xl flex items-center justify-center text-[#1b0d00] rounded-lg hover:bg-[#ac9e91] transition" | ||
| style={{ fontFamily: "Rockwell, serif" }} | ||
| > | ||
| <ArrowBigLeft className="inline-block mr-1" /> | ||
| {prevChapter.title} | ||
| </Link> | ||
| ) : ( | ||
| <div /> | ||
| )} | ||
|
|
||
| {nextChapter ? ( | ||
| <Link | ||
| href={`/sem5/ada2/${nextChapter.id}`} | ||
| className="px-4 py-2 bg-[#e2d1c1] text-lg md:text-xl flex items-center justify-center text-[#1b0d00] rounded-lg hover:bg-[#ac9e91] transition" | ||
| style={{ fontFamily: "Rockwell, serif" }} | ||
| > | ||
| {nextChapter.title} | ||
| <ArrowBigRight className="inline-block ml-1" /> | ||
| </Link> | ||
| ) : ( | ||
| <div /> | ||
| )} | ||
|
|
||
| </div> | ||
|
|
||
| </div> | ||
| ); | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.