<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[SolveLog]]></title><description><![CDATA[SolveLog]]></description><link>https://solvelogs.hashnode.dev</link><image><url>https://cdn.hashnode.com/res/hashnode/image/upload/v1593680282896/kNC7E8IR4.png</url><title>SolveLog</title><link>https://solvelogs.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Tue, 01 Sep 2026 16:28:13 GMT</lastBuildDate><atom:link href="https://solvelogs.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[What Building an Algorithm Learning Website Taught Me About How We Learn]]></title><description><![CDATA[Building SolveLogs started with a simple personal problem: I had solved many programming questions, but returning to them later was surprisingly difficult.
The solution files were still there. The cod]]></description><link>https://solvelogs.hashnode.dev/what-building-an-algorithm-learning-website-taught-me-about-how-we-learn</link><guid isPermaLink="true">https://solvelogs.hashnode.dev/what-building-an-algorithm-learning-website-taught-me-about-how-we-learn</guid><dc:creator><![CDATA[Nav]]></dc:creator><pubDate>Sun, 30 Aug 2026 16:54:18 GMT</pubDate><content:encoded><![CDATA[<p>Building SolveLogs started with a simple personal problem: I had solved many programming questions, but returning to them later was surprisingly difficult.</p>
<p>The solution files were still there. The code still worked. But I could not always remember the thought process that led to the answer.</p>
<p>Sometimes I would open something I had written only a few weeks earlier and need to understand it all over again. That made me realise that saving a correct solution is not the same as saving what I learned.</p>
<p>That small frustration became the beginning of <a href="https://solvelogs.com/">SolveLogs</a>.</p>
<h2>The gap between reading and understanding</h2>
<p>When learning algorithms, it is easy to feel that you understand something while reading it.</p>
<p>The explanation sounds reasonable. The finished solution looks short. The example produces the expected answer.</p>
<p>Then you close the page and try to solve a similar problem on your own.</p>
<p>Suddenly, the idea feels much less obvious.</p>
<p>I experienced this repeatedly. I could recognise an approach after seeing it, but recognition was not the same as being able to produce it independently.</p>
<p>That gap became one of the most interesting parts of building the website.</p>
<p>I started paying more attention to the questions that appear before the final answer:</p>
<ul>
<li><p>What information matters at this point?</p>
</li>
<li><p>What changed after the last decision?</p>
</li>
<li><p>Why is part of the input no longer relevant?</p>
</li>
<li><p>What mistake would lead the process in the wrong direction?</p>
</li>
<li><p>How can the reasoning be explained without assuming that the reader already knows it?</p>
</li>
</ul>
<p>Those questions are often more valuable than the finished output.</p>
<h2>The final answer hides most of the work</h2>
<p>A completed algorithm can look much simpler than the thinking behind it.</p>
<p>Binary search is a good example. Its final form is compact, but a learner still needs to understand why a particular portion of the search space can be ignored.</p>
<p>Graph traversal has the same problem. A final traversal order tells us where the algorithm went, but not necessarily why it visited nodes in that order.</p>
<p>Many programming techniques become easy to memorise without becoming easy to understand.</p>
<p>While working on SolveLogs, I found myself returning to the same principle:</p>
<blockquote>
<p>The useful part of an explanation is not only what happened, but why the next decision became possible.</p>
</blockquote>
<p>That sounds obvious, but it changed how I approached the project.</p>
<p>Instead of treating an explanation as something placed beside the answer, I began thinking of it as the path connecting the problem to the answer.</p>
<h2>Making something clear is harder than making it correct</h2>
<p>One of the humbling parts of building an educational website is discovering that correctness is only the beginning.</p>
<p>An explanation can be accurate and still leave the reader confused.</p>
<p>The person creating it already knows what every term means. The reader does not. This makes it easy to skip a connection that feels obvious to the author.</p>
<p>The same is true for visual material. A visual can look attractive without helping someone understand the underlying idea.</p>
<p>This taught me to pay more attention to what a learner might reasonably misunderstand.</p>
<p>If a concept needs to be read several times, perhaps the explanation is carrying too much at once. If the reader reaches the answer without understanding the decision that produced it, perhaps an important part of the story is missing.</p>
<p>That process has also improved my own understanding. Whenever I struggle to explain something simply, it usually means I need to examine it more carefully.</p>
<h2>Learning requires participation</h2>
<p>Another thing I have come to believe is that reading alone is rarely enough.</p>
<p>A learner needs moments where they pause, predict what happens next, and check whether their reasoning was correct.</p>
<p>Even a small prediction changes the experience from passive reading into active learning.</p>
<p>That does not mean every lesson needs to feel like a game. It simply means the learner should have a reason to think before the explanation gives everything away.</p>
<p>This idea influenced the public lessons on SolveLogs, including the <a href="https://solvelogs.com/learn/breadth-first-search/">breadth-first search walkthrough</a>. The intention is not to replace study or practice, but to make the reasoning easier to inspect before the learner tries it independently.</p>
<h2>Building for learners changes the builder</h2>
<p>I originally thought I was creating a place to organise work I had already completed.</p>
<p>Instead, the project kept showing me where my own understanding was incomplete.</p>
<p>It is easy to say that an algorithm “just works” when you have used it many times. It is much harder to explain its decisions to someone encountering it for the first time.</p>
<p>That challenge has made the project worthwhile.</p>
<p>Every lesson forces me to slow down and ask whether I understand the idea well enough to describe it clearly. Sometimes the answer is yes. Sometimes I discover that I only remember the usual implementation.</p>
<p>Those are very different things.</p>
<h2>What SolveLogs is becoming</h2>
<p>SolveLogs still reflects the original idea: a place where programming solutions can be revisited and understood rather than merely stored.</p>
<p>But it is also becoming a collection of lessons for people who want to see how an algorithm reaches its result.</p>
<p>I do not expect visual explanations to replace solving problems. There is no substitute for trying, getting stuck, correcting mistakes, and attempting the problem again.</p>
<p>The goal is to make the difficult transition from “I have seen this before” to “I understand why this works” a little less frustrating.</p>
<p>The most important lesson I have learned from building the site is simple:</p>
<p>A correct answer is useful, but the reasoning that survives after the answer is forgotten is much more valuable.</p>
<p>That is what I want SolveLogs to preserve.</p>
<hr />
<p>Explore SolveLogs: <a href="https://solvelogs.com/">https://solvelogs.com/</a></p>
]]></content:encoded></item><item><title><![CDATA[Seven elements, three comparisons: binary search as an animation]]></title><description><![CDATA[Binary search is one of those algorithms that everyone can describe and plenty of us still get wrong when we write it. The description is easy — halve the interval until you find the target. The detai]]></description><link>https://solvelogs.hashnode.dev/seven-elements-three-comparisons-binary-search-as-an-animation</link><guid isPermaLink="true">https://solvelogs.hashnode.dev/seven-elements-three-comparisons-binary-search-as-an-animation</guid><category><![CDATA[algorithms]]></category><dc:creator><![CDATA[Nav]]></dc:creator><pubDate>Fri, 28 Aug 2026 04:11:34 GMT</pubDate><content:encoded><![CDATA[<p>Binary search is one of those algorithms that everyone can describe and plenty of us still get wrong when we write it. The description is easy — halve the interval until you find the target. The details are where it goes sideways: whether the bound is inclusive, whether <code>mid</code> can overflow, whether the loop is <code>&lt;</code> or <code>&lt;=</code>, whether you return the index or the insertion point.</p>
<p>Here is the whole thing running on a seven-element array, searching for 16.</p>
<p><img src="https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/0dh146hbdpv9cw631joj.gif" alt="Binary search stepping through a sorted array, narrowing from seven elements to one" /></p>
<h2>What the picture makes obvious</h2>
<p>Reading the code, the halving is a claim you accept. Watching it, the halving is a thing you see happen.</p>
<p>Three moments stand out that I never noticed from the code alone:</p>
<p><strong>Step 3 throws away four of seven elements after one comparison.</strong> <code>values[3] = 12</code> is less than 16, so indices 0 through 3 are gone at once. Not one element — over half the array, from a single <code>&lt;</code>. That is the entire algorithm in one frame, and it is the part the O(log n) notation hides rather than explains.</p>
<p><strong>The interval, not the position, is the state.</strong> I used to think of binary search as "a pointer that jumps around." It is not. The state is <code>[lo, hi]</code>, and <code>mid</code> is just a derived value you compute fresh each pass. Once the animation shows the window shrinking instead of a cursor moving, the off-by-one errors mostly stop, because you start asking "is my interval still correct?" instead of "is my index right?"</p>
<p><strong>The last step is a comparison, not a discovery.</strong> At step 5 the interval is a single candidate. You still have to check it. Skipping that check is the classic bug where you return an index for a target that was never in the array.</p>
<h2>Why seven elements matter</h2>
<p>Seven is small enough to hold in your head and large enough to need three comparisons. A million-element array needs twenty. The animation is short, but the shape of what you are watching does not change as the input grows — that is the actual claim binary search makes, and it is easier to believe once you have watched the small version resolve.</p>
<h2>What I am curious about</h2>
<p>I have been building these step-by-step animations for data structures and algorithms, and I keep going back and forth on how much to show.</p>
<ul>
<li>Is six steps the right pace, or does it move too slowly for something you already know?</li>
<li>Does the explanation text under each step help, or would you rather just watch the array and work it out?</li>
<li>Which algorithm is hardest for you to picture? I find graph traversals fine and dynamic programming almost impossible to animate usefully — the table fills in, but the <em>reason</em> each cell gets its value is invisible.</li>
</ul>
<p>Genuinely curious what people think. If you have seen a visualisation that made something click for you, I would like to see it.</p>
<p>The full walkthrough with the code in Python, C++ and Java is at <a href="https://solvelogs.com/learn/binary-search/">solvelogs.com/learn/binary-search</a> — free, no signup.</p>
]]></content:encoded></item><item><title><![CDATA[What I learned writing 1,096 tests for algorithm animations]]></title><description><![CDATA[I spent the last few months building visual walkthroughs for data structures and algorithms. Not diagrams — step-by-step animations where you watch the pointers move, the stack grow, and the visited s]]></description><link>https://solvelogs.hashnode.dev/what-i-learned-writing-1-096-tests-for-algorithm-animations</link><guid isPermaLink="true">https://solvelogs.hashnode.dev/what-i-learned-writing-1-096-tests-for-algorithm-animations</guid><category><![CDATA[algorithms]]></category><dc:creator><![CDATA[Nav]]></dc:creator><pubDate>Fri, 28 Aug 2026 04:08:15 GMT</pubDate><content:encoded><![CDATA[<p>I spent the last few months building visual walkthroughs for data structures and algorithms. Not diagrams — step-by-step animations where you watch the pointers move, the stack grow, and the visited set fill in.</p>
<p>Somewhere in the middle of it I discovered the animations were lying to me. Here is what went wrong and what I did about it.</p>
<h2>The problem with hand-written animation steps</h2>
<p>My first version hardcoded every animation frame. A binary search page had a list of steps like this:</p>
<pre><code class="language-js">steps: [
  { lo: 0, hi: 9, mid: 4, note: "Check the middle" },
  { lo: 5, hi: 9, mid: 7, note: "Target is larger, go right" },
  // ...
]
</code></pre>
<p>This works right up until you change the input array. Then every frame after the first is quietly wrong, and nothing tells you. The animation still plays. It still looks convincing. It just teaches the wrong thing.</p>
<p>I found this the embarrassing way: a tree traversal page was animating the correct-looking sequence for a tree that no longer matched the diagram beside it. The picture said one thing, the animation said another, and both were rendered from different sources of truth.</p>
<h2>Running the real algorithm instead</h2>
<p>The fix was to stop writing the frames and start recording them. Each page now runs the actual algorithm and logs a snapshot at every meaningful state change:</p>
<pre><code class="language-js">function trace(arr, target) {
  const steps = [];
  let lo = 0, hi = arr.length - 1;

  while (lo &lt;= hi) {
    const mid = (lo + hi) &gt;&gt; 1;
    steps.push({ lo, hi, mid, note: `Compare ${arr[mid]} against ${target}` });

    if (arr[mid] === target) return steps;
    if (arr[mid] &lt; target) lo = mid + 1;
    else hi = mid - 1;
  }
  return steps;
}
</code></pre>
<p>The animation is now a byproduct of the algorithm, not a parallel description of it. Change the input and every frame updates. Break the algorithm and the animation breaks visibly, in the same way.</p>
<h2>The part that actually mattered</h2>
<p>The real win was that this made the animations <strong>testable</strong>. Once the steps come from running code, you can assert on the last one:</p>
<pre><code class="language-js">const steps = trace([1, 3, 5, 7, 9, 11], 7);
assert.equal(steps.at(-1).mid, 3);
</code></pre>
<p>I now have 1,096 of these assertions across every animation on the site. They run on every build. The suite has caught things I would never have noticed by watching:</p>
<ul>
<li>A heap animation that showed the sift-down but stopped one swap early, so the final heap it displayed was not actually a valid heap.</li>
<li>Ten separate pages animating a linked list to explain a tree, because the generic fallback visual was easier than writing the right one.</li>
<li>Several tracers truncated at exactly seven steps — a number that had crept in as a default and then silently became the ceiling for operations that needed fourteen.</li>
</ul>
<p>That last one is my favourite failure. Every one of those pages looked finished.</p>
<h2>What I would tell my earlier self</h2>
<p><strong>If a visual explanation is not generated by the thing it explains, it will drift.</strong> Documentation drifts from code for exactly the same reason, and we have long since accepted that generated docs beat hand-written ones. Animations are no different — they are just documentation that moves.</p>
<p><strong>Test the output, not the rendering.</strong> I do not screenshot-test the SVG. I assert on the final state of the trace. That catches the errors that matter (wrong algorithm) and ignores the ones that do not (a node moved three pixels).</p>
<p><strong>A convincing wrong explanation is worse than no explanation.</strong> A learner who reads a static wrong sentence often catches it. A learner watching a smooth animation assumes the machine knows better than they do. Getting this right felt less like polish and more like an obligation.</p>
<h2>The result</h2>
<p>The site is <a href="https://solvelogs.com">SolveLog</a> — worked LeetCode problems and data structure lessons, each with its own generated animation. A few where the tracer approach earns its keep:</p>
<ul>
<li><a href="https://solvelogs.com/learn/binary-search/">Binary search</a> — watch the search window actually collapse</li>
<li><a href="https://solvelogs.com/learn/avl-trees/">AVL trees</a> — the rebalance rotations are the whole point, and they are impossible to follow as static pictures</li>
<li><a href="https://solvelogs.com/learn/backtracking/">Backtracking</a> — the call stack panel beside the tree is what made this click for me</li>
</ul>
<p>It is free and there is no signup. I built it to learn this material properly myself, and the testing discipline above is the only reason I now trust it.</p>
<p>Happy to answer questions about the tracer architecture in the comments.</p>
]]></content:encoded></item></channel></rss>