Skip to content

Instantly share code, notes, and snippets.

View koen-lee's full-sized avatar

Koen van Leeuwen koen-lee

View GitHub Profile
private static Quad UnmemoizedStep(Quad q)
{
Debug.Assert(q.Level >= 2);
Quad r;
if (q.IsEmpty)
r = Empty(q.Level - 1);
else if (q.Level == 2)
r = StepBaseCase(q);
else
{
[TestFixture]
public class SafeListTests
{
[Test]
public void TestRemoveWithDiscards()
{
// Fill with 1..10
var undertest = SafeList<int>.Empty.AddRange(Enumerable.Range(1, 10));
Assert.AreEqual(10, undertest.Count);
@koen-lee
koen-lee / faster.cs
Last active November 19, 2019 07:14
Implementation for http://ayende.com/blog/163394/new-interview-question, without (explicit) sorting.
using System;
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
namespace CodeSamples
{
[TestFixture]
public class FindRunTests