Flatten a tree to a collection of nodes
I think you want to flatten each child in turn:

private IEnumerable&lt;MoveTreeNode&gt; Flatten()
{
    yield return this;

    foreach (var node in Children.SelectMany(child =&gt; child.Flatten()))
    {
        yield return node;
    }
}


That way you won't flatten the whole tree first.

Edit:

It's more difficult to talk about things so let's look at some code. SelectMany is roughly equal to:

public static IEnumerable&lt;TOut&gt; SelectMany&lt;T, TOut&gt;(this IEnumerable&lt;T&gt; source, Func&lt;T, IEnumerable&lt;TOut&gt;&gt; selector)
{
    foreach (var item in source)
    {
        foreach (var subItem in selector(item))
        {
            yield return subItem;
        }
    } 
}


So as you can see, we will definitely get all of the nodes and if you stop iterating before the end (e.g. by calling .First()) you will only call Flatten() on a single child.