LeetCode: Binary Tree Zigzag Level Order Traversal C#
Your implementation is close, but it can be a bit shorter. You correctly use two stacks, but you duplicate the code alternating between using the two. That's a bit of a waste of space. Instead, at the end of the first while loop, you can just assign nextLevel to currentLevel, create a new stack to nextLevel, and repeat:

    while (currentLeveL.Count &gt; 0 || nextLevel.Count &gt; 0)
    {
        var nodes = new List&lt;int&gt;();
        while (currentLeveL.Count &gt; 0)
        {
            var curr = currentLeveL.Pop();
            if (curr.left != null)
            {
                nextLevel.Push(curr.left);
            }

            if (curr.right != null)
            {
                nextLevel.Push(curr.right);
            }
            nodes.Add(curr.val);
        }

        if (nodes.Count &gt; 0)
        {
            result.Add(nodes);
        }
        currentLevel = nextLevel;
        nextLevel = new Stack&lt;TreeNode&gt;();
    }


The while condition can also be made easier, nextLevel is known to be empty when it is evaluated:

while (currentLeveL.Count &gt; 0)




Since you're looping over the stack, only removing each item, not adding items back or anything, you can just replace the while for a foreach:

public static IList&lt;IList&lt;int&gt;&gt; ZigzagLevelOrder(TreeNode root)
{
    List&lt;IList&lt;int&gt;&gt; result = new List&lt;IList&lt;int&gt;&gt;();
    if (root == null)
    {
        return result;
    }
    Stack&lt;TreeNode&gt; currentLeveL = new Stack&lt;TreeNode&gt;();
    Stack&lt;TreeNode&gt; nextLevel = new Stack&lt;TreeNode&gt;();
    currentLeveL.Push(root);
    while (currentLeveL.Count &gt; 0)
    {
        var nodes = new List&lt;int&gt;();
        foreach(var curr in currentLeveL)
        { 
            if (curr.left != null)
            {
                nextLevel.Push(curr.left);
            }

            if (curr.right != null)
            {
                nextLevel.Push(curr.right);
            }
            nodes.Add(curr.val);
        }

        if (nodes.Count &gt; 0)
        {
            result.Add(nodes);
        }
        currentLeveL = nextLevel;
        nextLevel = new Stack&lt;TreeNode&gt;();
    }

    return result;
}