<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Algorithmic Edge Archives - ChoralSoft</title>
	<atom:link href="https://choralsoft.com/category/algorithmic-edge/feed/" rel="self" type="application/rss+xml" />
	<link>https://choralsoft.com/category/algorithmic-edge/</link>
	<description>Privacy-conscious apps, books and audiobooks</description>
	<lastBuildDate>Wed, 21 Oct 2026 15:44:47 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.4</generator>
<site xmlns="com-wordpress:feed-additions:1">214551553</site>	<item>
		<title>How to Explain Algorithm Correctness in an Interview</title>
		<link>https://choralsoft.com/2026/10/21/how-to-explain-algorithm-correctness-in-an-interview/</link>
		
		<dc:creator><![CDATA[alavingi]]></dc:creator>
		<pubDate>Wed, 21 Oct 2026 15:41:29 +0000</pubDate>
				<category><![CDATA[Algorithmic Edge]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://choralsoft.com/?p=11020</guid>

					<description><![CDATA[<p>← Back to Blog &#38; Articles A correct program is stronger when you can explain why it must work. A [&#8230;]</p>
<p>The post <a href="https://choralsoft.com/2026/10/21/how-to-explain-algorithm-correctness-in-an-interview/">How to Explain Algorithm Correctness in an Interview</a> appeared first on <a href="https://choralsoft.com">ChoralSoft</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><a href="/blog-articles/">← Back to Blog &amp; Articles</a></p>
<p><strong>A correct program is stronger when you can explain why it must work. A short proof also exposes bugs before the interviewer has to find them.</strong></p>
<h2>State the invariant</h2>
<p>Describe what is true before and after every iteration or recursive call. For binary search, any existing target remains inside the current interval. For a sliding window, the stored counts match exactly the elements between its boundaries.</p>
<h2>Connect the steps</h2>
<p>Explain initialization, preservation, and termination. Show that the invariant is true initially, that each update keeps it true, and that the stopping condition converts it into the desired answer. This structure is concise and works for many algorithm families.</p>
<h2>Address boundaries and complexity</h2>
<p>Mention empty input, duplicates, missing answers, overflow, and maximum depth where relevant. Then derive time and space costs from the operations performed rather than reciting a label. Clear reasoning often matters as much as the final code.</p>
<h2>Continue with the book</h2>
<p>Explore the full treatment, worked examples, and exercises in <a href="https://choralsoft.com/books/algorithmic-edge/"><em>Algorithmic Edge</em></a>.</p>
<hr>
<p><small>Adapted from <em>Algorithmic Edge</em>, published by Choral Software. Article text and original examples © 2026 Choral Software. All rights reserved.</small></p>
<p>The post <a href="https://choralsoft.com/2026/10/21/how-to-explain-algorithm-correctness-in-an-interview/">How to Explain Algorithm Correctness in an Interview</a> appeared first on <a href="https://choralsoft.com">ChoralSoft</a>.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">11020</post-id>	</item>
		<item>
		<title>Greedy or Dynamic Programming? Test the Irreversible Choice</title>
		<link>https://choralsoft.com/2026/10/21/greedy-or-dynamic-programming-test-the-irreversible-choice/</link>
		
		<dc:creator><![CDATA[alavingi]]></dc:creator>
		<pubDate>Wed, 21 Oct 2026 15:41:24 +0000</pubDate>
				<category><![CDATA[Algorithmic Edge]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://choralsoft.com/?p=11018</guid>

					<description><![CDATA[<p>← Back to Blog &#38; Articles Greedy algorithms commit to a locally attractive choice. Dynamic programming keeps alternatives alive through [&#8230;]</p>
<p>The post <a href="https://choralsoft.com/2026/10/21/greedy-or-dynamic-programming-test-the-irreversible-choice/">Greedy or Dynamic Programming? Test the Irreversible Choice</a> appeared first on <a href="https://choralsoft.com">ChoralSoft</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><a href="/blog-articles/">← Back to Blog &amp; Articles</a></p>
<p><strong>Greedy algorithms commit to a locally attractive choice. Dynamic programming keeps alternatives alive through reusable subproblems. The difference is whether an early decision can safely become irreversible.</strong></p>
<h2>What a greedy proof needs</h2>
<p>A plausible rule is not enough. Show that an optimal solution can be transformed to include the greedy choice without becoming worse, or show that the choice always stays ahead of every competitor. Interval scheduling works because selecting the earliest finishing compatible interval leaves maximal room for what follows.</p>
<h2>When dynamic programming is safer</h2>
<p>If a locally good decision changes which future options remain, and no exchange argument protects it, model the alternatives. Knapsack-style problems are classic examples: the highest value or best value-per-weight item can block a better combination.</p>
<h2>Use counterexamples early</h2>
<p>Try to break a proposed greedy rule with the smallest instance you can invent. Counterexamples expose hidden interactions quickly. If the rule survives, articulate the invariant; if it fails, identify the state needed to represent the unresolved choices.</p>
<h2>Continue with the book</h2>
<p>Explore the full treatment, worked examples, and exercises in <a href="https://choralsoft.com/books/algorithmic-edge/"><em>Algorithmic Edge</em></a>.</p>
<hr>
<p><small>Adapted from <em>Algorithmic Edge</em>, published by Choral Software. Article text and original examples © 2026 Choral Software. All rights reserved.</small></p>
<p>The post <a href="https://choralsoft.com/2026/10/21/greedy-or-dynamic-programming-test-the-irreversible-choice/">Greedy or Dynamic Programming? Test the Irreversible Choice</a> appeared first on <a href="https://choralsoft.com">ChoralSoft</a>.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">11018</post-id>	</item>
		<item>
		<title>Dynamic Programming Starts with a State, Not a Table</title>
		<link>https://choralsoft.com/2026/10/21/dynamic-programming-starts-with-a-state-not-a-table/</link>
		
		<dc:creator><![CDATA[alavingi]]></dc:creator>
		<pubDate>Wed, 21 Oct 2026 15:41:19 +0000</pubDate>
				<category><![CDATA[Algorithmic Edge]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://choralsoft.com/?p=11016</guid>

					<description><![CDATA[<p>← Back to Blog &#38; Articles Dynamic programming becomes much easier when you stop beginning with an array. Begin by [&#8230;]</p>
<p>The post <a href="https://choralsoft.com/2026/10/21/dynamic-programming-starts-with-a-state-not-a-table/">Dynamic Programming Starts with a State, Not a Table</a> appeared first on <a href="https://choralsoft.com">ChoralSoft</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><a href="/blog-articles/">← Back to Blog &amp; Articles</a></p>
<p><strong>Dynamic programming becomes much easier when you stop beginning with an array. Begin by defining a question whose answer can be reused.</strong></p>
<h2>Define the state in a sentence</h2>
<p>A state should specify exactly what its inputs mean. For example: dp[i] is the best score obtainable from the first i items, or solve(i, remaining) is the number of valid completions from position i with a given balance. If the sentence is ambiguous, the implementation will be too.</p>
<h2>Derive the transition</h2>
<p>List the choices available from one state and identify the smaller states they lead to. Then decide how those results combine: minimum, maximum, sum, or boolean OR. The transition should follow from the problem, not from a memorized template.</p>
<h2>Finish the model</h2>
<p>Name the base cases, the evaluation order, and the answer state. Memoization evaluates only requested states; tabulation makes ordering explicit and may reduce overhead. Before optimizing memory, write a correct recurrence and test tiny cases by hand.</p>
<h2>Continue with the book</h2>
<p>Explore the full treatment, worked examples, and exercises in <a href="https://choralsoft.com/books/algorithmic-edge/"><em>Algorithmic Edge</em></a>.</p>
<hr>
<p><small>Adapted from <em>Algorithmic Edge</em>, published by Choral Software. Article text and original examples © 2026 Choral Software. All rights reserved.</small></p>
<p>The post <a href="https://choralsoft.com/2026/10/21/dynamic-programming-starts-with-a-state-not-a-table/">Dynamic Programming Starts with a State, Not a Table</a> appeared first on <a href="https://choralsoft.com">ChoralSoft</a>.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">11016</post-id>	</item>
		<item>
		<title>BFS or DFS? A Practical Interview Decision Guide</title>
		<link>https://choralsoft.com/2026/10/21/bfs-or-dfs-a-practical-interview-decision-guide/</link>
		
		<dc:creator><![CDATA[alavingi]]></dc:creator>
		<pubDate>Wed, 21 Oct 2026 15:41:14 +0000</pubDate>
				<category><![CDATA[Algorithmic Edge]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://choralsoft.com/?p=11014</guid>

					<description><![CDATA[<p>← Back to Blog &#38; Articles Breadth-first search and depth-first search visit the same graph in different orders. The right [&#8230;]</p>
<p>The post <a href="https://choralsoft.com/2026/10/21/bfs-or-dfs-a-practical-interview-decision-guide/">BFS or DFS? A Practical Interview Decision Guide</a> appeared first on <a href="https://choralsoft.com">ChoralSoft</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><a href="/blog-articles/">← Back to Blog &amp; Articles</a></p>
<p><strong>Breadth-first search and depth-first search visit the same graph in different orders. The right choice follows from the information the problem asks you to preserve.</strong></p>
<h2>Choose breadth-first search</h2>
<p>BFS explores by distance from the start. In an unweighted graph it naturally finds a path with the fewest edges. It is also a good fit for level-order tree traversal, minimum-step transformations, and problems where the earliest reachable state is the answer.</p>
<h2>Choose depth-first search</h2>
<p>DFS follows one branch before returning. It fits exhaustive exploration, connected components, cycle detection, topological reasoning, backtracking, and tree calculations that depend on child results. Its recursive form can be concise, although an explicit stack avoids recursion-depth limits.</p>
<h2>Explain the trade-off</h2>
<p>Both traversals are typically linear in vertices plus edges when adjacency lists are used. Their memory profiles differ with graph shape: BFS may hold a wide frontier, while DFS may hold a deep path. Always track visited states unless revisiting is intentional, and clarify whether the graph is directed.</p>
<h2>Continue with the book</h2>
<p>Explore the full treatment, worked examples, and exercises in <a href="https://choralsoft.com/books/algorithmic-edge/"><em>Algorithmic Edge</em></a>.</p>
<hr>
<p><small>Adapted from <em>Algorithmic Edge</em>, published by Choral Software. Article text and original examples © 2026 Choral Software. All rights reserved.</small></p>
<p>The post <a href="https://choralsoft.com/2026/10/21/bfs-or-dfs-a-practical-interview-decision-guide/">BFS or DFS? A Practical Interview Decision Guide</a> appeared first on <a href="https://choralsoft.com">ChoralSoft</a>.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">11014</post-id>	</item>
		<item>
		<title>Sliding Windows: Fixed Size or Variable Size?</title>
		<link>https://choralsoft.com/2026/10/21/sliding-windows-fixed-size-or-variable-size/</link>
		
		<dc:creator><![CDATA[alavingi]]></dc:creator>
		<pubDate>Wed, 21 Oct 2026 15:40:58 +0000</pubDate>
				<category><![CDATA[Algorithmic Edge]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://choralsoft.com/?p=11012</guid>

					<description><![CDATA[<p>← Back to Blog &#38; Articles A sliding window reuses information about a contiguous range instead of recomputing that range [&#8230;]</p>
<p>The post <a href="https://choralsoft.com/2026/10/21/sliding-windows-fixed-size-or-variable-size/">Sliding Windows: Fixed Size or Variable Size?</a> appeared first on <a href="https://choralsoft.com">ChoralSoft</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><a href="/blog-articles/">← Back to Blog &amp; Articles</a></p>
<p><strong>A sliding window reuses information about a contiguous range instead of recomputing that range after every move. The first decision is whether the window size is fixed or controlled by a condition.</strong></p>
<h2>Fixed-size windows</h2>
<p>Use a fixed window when every candidate contains exactly k items: the largest sum of k values, a k-day moving average, or the most frequent symbol in a substring of length k. Add the entering item, remove the leaving item, and update the answer.</p>
<h2>Variable-size windows</h2>
<p>Use a variable window when the prompt asks for the shortest or longest range satisfying a rule. Expand the right edge to gather information, then move the left edge while the condition remains valid or must be repaired. This works best when the condition changes monotonically as the window grows or shrinks.</p>
<h2>Know when it does not fit</h2>
<p>A window is not automatically valid for every substring problem. Negative numbers can break sum-based monotonicity, and a requirement involving arbitrary rearrangement may need a different structure. Define the stored state, the validity test, and the exact moment the answer is recorded before coding.</p>
<h2>Continue with the book</h2>
<p>Explore the full treatment, worked examples, and exercises in <a href="https://choralsoft.com/books/algorithmic-edge/"><em>Algorithmic Edge</em></a>.</p>
<hr>
<p><small>Adapted from <em>Algorithmic Edge</em>, published by Choral Software. Article text and original examples © 2026 Choral Software. All rights reserved.</small></p>
<p>The post <a href="https://choralsoft.com/2026/10/21/sliding-windows-fixed-size-or-variable-size/">Sliding Windows: Fixed Size or Variable Size?</a> appeared first on <a href="https://choralsoft.com">ChoralSoft</a>.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">11012</post-id>	</item>
		<item>
		<title>Two Pointers: Recognizing the Pattern Before You Code</title>
		<link>https://choralsoft.com/2026/10/21/two-pointers-recognizing-the-pattern-before-you-code/</link>
		
		<dc:creator><![CDATA[alavingi]]></dc:creator>
		<pubDate>Wed, 21 Oct 2026 15:40:32 +0000</pubDate>
				<category><![CDATA[Algorithmic Edge]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://choralsoft.com/?p=11010</guid>

					<description><![CDATA[<p>← Back to Blog &#38; Articles Two pointers is less a single algorithm than a way to avoid repeating work. [&#8230;]</p>
<p>The post <a href="https://choralsoft.com/2026/10/21/two-pointers-recognizing-the-pattern-before-you-code/">Two Pointers: Recognizing the Pattern Before You Code</a> appeared first on <a href="https://choralsoft.com">ChoralSoft</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><a href="/blog-articles/">← Back to Blog &amp; Articles</a></p>
<p><strong>Two pointers is less a single algorithm than a way to avoid repeating work. The pattern becomes useful when two positions can move through ordered data while preserving a clear invariant.</strong></p>
<h2>Signals that suggest two pointers</h2>
<p>Look for a sorted sequence, a pair or interval, or a requirement to compare values from opposite ends. Common prompts ask for a target sum, removal of duplicates, interval contraction, or an in-place partition. The strongest clue is that moving one pointer lets you rule out many candidates at once.</p>
<h2>Choose the movement rule first</h2>
<p>Suppose a sorted list must contain two values whose sum equals a target. If the current sum is too small, advancing the left pointer is the only move that can increase it. If the sum is too large, retreating the right pointer is the only move that can decrease it. State this rule before writing the loop.</p>
<h2>Protect the invariant</h2>
<p>A good explanation names what remains true: every discarded pair is impossible, and any valid answer still lies between the pointers. Test an empty list, one item, duplicates, negative values, and the case where no pair exists. This turns a coding trick into a defensible algorithm.</p>
<h2>Continue with the book</h2>
<p>Explore the full treatment, worked examples, and exercises in <a href="https://choralsoft.com/books/algorithmic-edge/"><em>Algorithmic Edge</em></a>.</p>
<hr>
<p><small>Adapted from <em>Algorithmic Edge</em>, published by Choral Software. Article text and original examples © 2026 Choral Software. All rights reserved.</small></p>
<p>The post <a href="https://choralsoft.com/2026/10/21/two-pointers-recognizing-the-pattern-before-you-code/">Two Pointers: Recognizing the Pattern Before You Code</a> appeared first on <a href="https://choralsoft.com">ChoralSoft</a>.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">11010</post-id>	</item>
	</channel>
</rss>
