Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/blogs/Content/dsaDifferent/content.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ const BlogContent = () => {
{ points: "Use language-specific benchmarks to verify performance assumptions" },
{ points: "Study standard library implementations of common structures" },
{ points: "Understand how your language's memory model affects data structures" },
{ points: "Don’t just translate code between languages—adapt it to leverage language strengths" }
{ points: "Don’t just translate code between languages, adapt it to leverage language strengths" }
];

return (
Expand Down
2 changes: 1 addition & 1 deletion app/blogs/Content/dsaDifferent/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const metadata = {
card: "summary_large_image",
title: "Are Data Structures and Algorithms Different for Different Languages?",
description:
"Do arrays, stacks, or recursion work the same in Python and C++? Learn how the core DSA concepts stay the same—but their implementation varies.",
"Do arrays, stacks, or recursion work the same in Python and C++? Learn how the core DSA concepts stay the same, but their implementation varies.",
images: ["./blog/dsaDifferent.png"],
},
category: "Technology",
Expand Down
2 changes: 1 addition & 1 deletion app/blogs/Content/dsaWebDev/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const metadata = {
openGraph: {
title: "Is Data Structures and Algorithms Important for Web Developers?",
description:
"Explore how learning DSA can boost your efficiency, optimize performance, and prepare you for tech interviews—even as a web developer.",
"Explore how learning DSA can boost your efficiency, optimize performance, and prepare you for tech interviews, even as a web developer.",
url: "./blog/dsaWebDev.png",
siteName: "DSA Visualizer",
locale: "en_IN",
Expand Down
2 changes: 1 addition & 1 deletion app/blogs/Content/timeRequired/content.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const BlogContent = () => {
};

const Paragraphs = [
`If you're a student, developer, or career switcher, you've likely asked: "How long will it take to learn Data Structures and Algorithms (DSA)?" The answer isn't one-size-fits-all — it depends on your goals, consistency, and background.`,
`If you're a student, developer, or career switcher, you've likely asked: "How long will it take to learn Data Structures and Algorithms (DSA)?" The answer isn't one-size-fits-all: it depends on your goals, consistency, and background.`,
`Before estimating time, let's define what “mastering” DSA really means. Mastery isn't just knowing syntax or solving rote problems. It means pattern recognition, approaching unseen questions with confidence, and making trade-offs in real-world system design.`,
`For most learners, 3 months gets you foundational knowledge, 6–9 months develops confidence for interviews, and 12+ months results in true mastery. DSA is a long-term game.`,
`Here's a simple 12-week roadmap:\n\n- Weeks 1–2: Arrays, Strings, HashMaps\n- Weeks 3–4: Stacks, Queues, Recursion\n- Weeks 5–6: Linked Lists, Trees\n- Weeks 7–8: Heaps, Binary Trees, BSTs\n- Weeks 9–10: Graphs, DFS/BFS\n- Weeks 11–12: DP, Tries, Bit Manipulation`,
Expand Down
8 changes: 4 additions & 4 deletions app/blogs/Content/whatIsDS/content.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ const BlogContent = () => {
};

const Paragraphs = [
`If you're new to coding, you've probably come across terms like array, stack, or linked list and thought, "What does that even mean?" Don't worry — you're not alone. These are all types of data structures, and they form the foundation of how programs organize and process information.`,
`In this guide, we'll break down what data structures are, why they matter, and introduce you to the most common types — all in simple language with relatable examples.`,
`If you're new to coding, you've probably come across terms like array, stack, or linked list and thought, "What does that even mean?" Don't worry, you're not alone. These are all types of data structures, and they form the foundation of how programs organize and process information.`,
`In this guide, we'll break down what data structures are, why they matter, and introduce you to the most common types, all in simple language with relatable examples.`,
`A data structure is a way to organize and store data in a computer so it can be used efficiently.`,
`Think of it like organizing your wardrobe: shirts go in one drawer, pants in another, socks in a box. Each drawer (or structure) is designed to hold and access a specific type of item. Similarly, in programming, different data structures are used depending on the type of data and what you want to do with it.`,
`Here's why every programmer needs to understand data structures:`,
`Data structures are the toolbox every programmer must carry. Mastering them helps you build efficient, scalable, and real-world applications. Start small — practice with basic structures, and slowly move up to complex ones. If you're consistent, what once felt like intimidating jargon will become second nature.`,
`Data structures are the toolbox every programmer must carry. Mastering them helps you build efficient, scalable, and real-world applications. Start small: practice with basic structures, and slowly move up to complex ones. If you're consistent, what once felt like intimidating jargon will become second nature.`,
];

const importancePoints = [
{ points: "Efficiency: The right structure makes programs faster and less memory-hungry" },
{ points: "Scalability: Handles larger data more smoothly" },
{ points: "Problem Solving: Many coding problems are based on data structures" },
{ points: "Real-World Use: From social media feeds to navigation systems — they're everywhere" },
{ points: "Real-World Use: From social media feeds to navigation systems, they're everywhere" },
];

const dataStructures = [
Expand Down
2 changes: 1 addition & 1 deletion app/components/ads/bottom.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const BottomAd = () => {

{minimized ? (
<div style={{ fontSize: "13px", padding: "6px", color: "#555" }}>
Ad minimized — click ▲ to reopen
Ad minimized. Click ▲ to reopen
</div>
) : (
<ins
Expand Down
4 changes: 2 additions & 2 deletions app/components/testimonial.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const TestimonialSection = () => {
{
name: 'Arnav Gupta',
email: '@Co-founder, Geekroom',
review: `DSA Visualizer, this could be the upcoming game-changer. When you're stuck on LeetCode or trying to debug your logic, it helps you actually see what your code is doing at each step. Whether you're just starting out or deep into competitive programming, this is something which can make learning DSA so much more intuitive and less frustrating. Well! my opinion says in the future, I'd love to see a built-in compiler or a feature where users can test their own code with custom inputs — that would take it to the next level. But even now, it's incredibly helpful and super polished!”`,
review: `DSA Visualizer, this could be the upcoming game-changer. When you're stuck on LeetCode or trying to debug your logic, it helps you actually see what your code is doing at each step. Whether you're just starting out or deep into competitive programming, this is something which can make learning DSA so much more intuitive and less frustrating. Well! my opinion says in the future, I'd love to see a built-in compiler or a feature where users can test their own code with custom inputs, that would take it to the next level. But even now, it's incredibly helpful and super polished!”`,
stars: 4,
},
{
Expand All @@ -34,7 +34,7 @@ const TestimonialSection = () => {
{
name: 'kartik',
email: '@kartik2005221',
review: `This platform made DSA so much easier to grasp. Everything's in one place — topics, visualizations, and practice. It really helped me connect the dots between theory and how things actually work.`,
review: `This platform made DSA so much easier to grasp. Everything's in one place: topics, visualizations, and practice. It really helped me connect the dots between theory and how things actually work.`,
stars: 5,
},
{
Expand Down
8 changes: 4 additions & 4 deletions app/cookies/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ const cookieSections = [
title: "Third-Party Cookies",
data: "We use cookies from the following third-party services, each governed by its own privacy policy:",
points: [
"Google Analytics — measures site traffic and usage patterns",
"Google AdSense — serves ads and may use cookies to personalize ads based on your visits to this and other sites",
"Supabase — sets authentication cookies to keep you signed in",
"Cloudflare Turnstile — sets cookies to verify you're not a bot on login and signup",
"Google Analytics: measures site traffic and usage patterns",
"Google AdSense: serves ads and may use cookies to personalize ads based on your visits to this and other sites",
"Supabase: sets authentication cookies to keep you signed in",
"Cloudflare Turnstile: sets cookies to verify you're not a bot on login and signup",
],
},
{
Expand Down
10 changes: 5 additions & 5 deletions app/privacy/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ const policySections = [
title: "Third-Party Services",
data: "We use the following third-party services, each of which may process data according to its own privacy policy:",
points: [
"Supabase — authentication and database storage for accounts and progress data",
"Google Analytics — website usage analytics",
"Google AdSense — displays ads and may use cookies to personalize them based on your visits to this and other sites; you can manage ad personalization at adssettings.google.com",
"Cloudflare Turnstile — bot/spam protection on login and signup",
"Vercel — hosting and performance analytics",
"Supabase: authentication and database storage for accounts and progress data",
"Google Analytics: website usage analytics",
"Google AdSense: displays ads and may use cookies to personalize them based on your visits to this and other sites; you can manage ad personalization at adssettings.google.com",
"Cloudflare Turnstile: bot/spam protection on login and signup",
"Vercel: hosting and performance analytics",
],
},
{
Expand Down
8 changes: 4 additions & 4 deletions app/visualizer/graph/algorithms/dijkstra/animation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const buildWeightedAdjList = (vertices, edges) => {
};

// Greedy relaxation: always finalize whichever unvisited vertex currently
// has the smallest tentative distance — since all weights are non-negative,
// has the smallest tentative distance, since all weights are non-negative,
// no edge discovered later could ever produce a shorter path to it.
const dijkstraWithSteps = (vertices, adjList, start) => {
const dist = {};
Expand Down Expand Up @@ -167,7 +167,7 @@ const DijkstraVisualizer = () => {
setStartVertex("A");
setTargetVertex("E");
clearResult();
setMessage("Loaded an example graph — click Run Dijkstra");
setMessage("Loaded an example graph, click Run Dijkstra");
};

const reset = () => {
Expand Down Expand Up @@ -202,7 +202,7 @@ const DijkstraVisualizer = () => {
setCurrent(step.vertex);
setVisited((p) => new Set(p).add(step.vertex));
setActiveEdge(null);
setMessage(`Finalize ${step.vertex} — no shorter path to it can exist now`);
setMessage(`Finalize ${step.vertex}: no shorter path to it can exist now`);
} else if (step.type === "relax") {
setActiveEdge({ from: step.from, to: step.to });
setDistances((prevD) => ({ ...prevD, [step.to]: step.newDist }));
Expand All @@ -220,7 +220,7 @@ const DijkstraVisualizer = () => {
setCurrent(null);
setActiveEdge(null);
setFinalPrev(prev);
setMessage("Dijkstra complete — every vertex now has its shortest distance from the start");
setMessage("Dijkstra complete: every vertex now has its shortest distance from the start");
setBusy(false);
}, STEP_DELAY);
}
Expand Down
12 changes: 6 additions & 6 deletions app/visualizer/graph/algorithms/dijkstra/content.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ const Content = () => {
const { theme } = useTheme();

const paragraphs = [
`Dijkstra's algorithm finds the shortest-distance path from a single start vertex to every other vertex in a weighted graph — "shortest" meaning the smallest total edge weight along the path, not the fewest edges (which is what plain BFS finds on an unweighted graph). It requires every edge weight to be non-negative; a single negative weight can break its core assumption and produce wrong answers.`,
`The algorithm keeps a tentative distance for every vertex, starting at 0 for the source and infinity for everything else. At each step, it finalizes whichever unvisited vertex currently has the smallest tentative distance — once a vertex is finalized, its distance is guaranteed correct and will never be revised again. Then it "relaxes" every edge out of that vertex: for each neighbor, if going through the just-finalized vertex would produce a shorter distance than what's currently recorded, the neighbor's distance is updated.`,
`The key insight behind why picking the smallest unvisited distance is always safe: since every edge weight is non-negative, any path to that vertex through a still-unvisited (and therefore farther-or-equal) vertex could only be equal or longer. There's no way a shortcut could still be waiting to be discovered. That guarantee is exactly what breaks down if a negative edge weight is allowed — a path through a vertex that currently looks farther away could later turn out shorter, and algorithms like Bellman-Ford exist specifically to handle that case.`,
`Dijkstra's algorithm finds the shortest-distance path from a single start vertex to every other vertex in a weighted graph: "shortest" meaning the smallest total edge weight along the path, not the fewest edges (which is what plain BFS finds on an unweighted graph). It requires every edge weight to be non-negative; a single negative weight can break its core assumption and produce wrong answers.`,
`The algorithm keeps a tentative distance for every vertex, starting at 0 for the source and infinity for everything else. At each step, it finalizes whichever unvisited vertex currently has the smallest tentative distance. Once a vertex is finalized, its distance is guaranteed correct and will never be revised again. Then it "relaxes" every edge out of that vertex: for each neighbor, if going through the just-finalized vertex would produce a shorter distance than what's currently recorded, the neighbor's distance is updated.`,
`The key insight behind why picking the smallest unvisited distance is always safe: since every edge weight is non-negative, any path to that vertex through a still-unvisited (and therefore farther-or-equal) vertex could only be equal or longer. There's no way a shortcut could still be waiting to be discovered. That guarantee is exactly what breaks down if a negative edge weight is allowed: a path through a vertex that currently looks farther away could later turn out shorter, and algorithms like Bellman-Ford exist specifically to handle that case.`,
`Dijkstra's algorithm (typically implemented with a min-priority-queue for efficiency) is the standard tool behind GPS and mapping route-finding, network routing protocols that pick the cheapest path between routers, and any scenario where "cheapest route through a weighted network" needs an exact answer rather than an approximation.`,
];

Expand All @@ -94,8 +94,8 @@ const Content = () => {
];

const complexity = [
{ points: "Time Complexity: O((V + E) log V) with a binary heap priority queue — each vertex is extracted once and each edge triggers at most one relaxation, both at logarithmic cost." },
{ points: "Space Complexity: O(V) — for the distance array, the previous-vertex pointers, and the priority queue." },
{ points: "Time Complexity: O((V + E) log V) with a binary heap priority queue, since each vertex is extracted once and each edge triggers at most one relaxation, both at logarithmic cost." },
{ points: "Space Complexity: O(V), for the distance array, the previous-vertex pointers, and the priority queue." },
];

return (
Expand Down Expand Up @@ -136,7 +136,7 @@ const Content = () => {
</div>

<div className="text-sm font-medium text-center text-gray-600 dark:text-gray-400 mb-2">
Shortest distances from A — the path A→C→B→D (1+1+3=5) beats A→B→D directly (3+3=6)
Shortest distances from A: the path A→C→B→D (1+1+3=5) beats A→B→D directly (3+3=6)
</div>
<WalkthroughDiagram />
</section>
Expand Down
4 changes: 2 additions & 2 deletions app/visualizer/graph/algorithms/dijkstra/quiz.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const DijkstraQuiz = () => {
"A random spanning tree of the graph"
],
correctAnswer: 1,
explanation: "Dijkstra minimizes the sum of edge weights along the path, not the number of edges — that distinction is what separates it from plain BFS."
explanation: "Dijkstra minimizes the sum of edge weights along the path, not the number of edges; that distinction is what separates it from plain BFS."
},
{
question: "What critical requirement must a graph's edge weights satisfy for Dijkstra's algorithm to work correctly?",
Expand All @@ -25,7 +25,7 @@ const DijkstraQuiz = () => {
"There must be no more than 10 edges"
],
correctAnswer: 1,
explanation: "A negative edge weight can violate the algorithm's core assumption and produce incorrect shortest-distance results — Bellman-Ford is used instead when negative weights are possible."
explanation: "A negative edge weight can violate the algorithm's core assumption and produce incorrect shortest-distance results; Bellman-Ford is used instead when negative weights are possible."
},
{
question: "At each step, which vertex does Dijkstra's algorithm finalize next?",
Expand Down
12 changes: 6 additions & 6 deletions app/visualizer/graph/algorithms/kruskal/animation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const find = (parent, v) => {

// Process edges cheapest-first; a Union-Find (disjoint set) tracks which
// vertices are already connected. An edge is only added if its two
// endpoints are in different sets — accepting it would otherwise create a
// endpoints are in different sets: accepting it would otherwise create a
// cycle, since both endpoints are already reachable from each other.
const kruskalWithSteps = (vertices, edges) => {
const parent = {};
Expand Down Expand Up @@ -139,7 +139,7 @@ const KruskalVisualizer = () => {
setVertices(EXAMPLE_VERTICES);
setEdges(EXAMPLE_EDGES);
clearResult();
setMessage("Loaded an example graph — click Run Kruskal's");
setMessage("Loaded an example graph, click Run Kruskal's");
};

const reset = () => {
Expand Down Expand Up @@ -174,14 +174,14 @@ const KruskalVisualizer = () => {
if (step.type === "accept") {
setVertexColors(componentColors(vertices, step.parentSnapshot));
setMstEdges((prev) => [...prev, step.edge]);
setMessage(`Accept ${step.edge.from}-${step.edge.to} (weight ${step.edge.weight}) — connects two separate components`);
setMessage(`Accept ${step.edge.from}-${step.edge.to} (weight ${step.edge.weight}): connects two separate components`);

const bars = document.querySelectorAll(".kruskal-node-active");
if (bars.length > 0) {
gsap.fromTo(bars, { scale: 1 }, { scale: 1.12, duration: 0.2, yoyo: true, repeat: 1 });
}
} else {
setMessage(`Reject ${step.edge.from}-${step.edge.to} (weight ${step.edge.weight}) — both endpoints are already connected, would create a cycle`);
setMessage(`Reject ${step.edge.from}-${step.edge.to} (weight ${step.edge.weight}): both endpoints are already connected, would create a cycle`);
}

i++;
Expand All @@ -190,7 +190,7 @@ const KruskalVisualizer = () => {
} else {
setTimeout(() => {
setTotalWeight(tw);
setMessage(`Kruskal's complete — minimum spanning tree total weight is ${tw}`);
setMessage(`Kruskal's complete: minimum spanning tree total weight is ${tw}`);
setBusy(false);
}, STEP_DELAY);
}
Expand Down Expand Up @@ -291,7 +291,7 @@ const KruskalVisualizer = () => {

{totalWeight !== null && (
<div className="mb-4 p-3 rounded-lg bg-emerald-100 dark:bg-emerald-900/40 text-emerald-800 dark:text-emerald-200 text-center text-sm font-medium">
MST edges: {mstEdges.map((e) => `${e.from}-${e.to}`).join(", ")} — total weight {totalWeight}
MST edges: {mstEdges.map((e) => `${e.from}-${e.to}`).join(", ")}, total weight {totalWeight}
</div>
)}

Expand Down
Loading
Loading