Leetcode: Flatten binary tree to linked list C#
The first condition is a bit conservative:


if (root == null || (root.left == null &amp;&amp; root.right == null))



Just if (root == null) would be enough, the rest of the implementation naturally handles the cases of root.left == null &amp;&amp; root.right == null.



Evaluating curr != root for every node, when it's only useful for the first node is a bit ugly.
You could get rid of that by not adding root itself on the stack, but its children. (In the right order, and when not null.)



head is a misleading name for a variable that traverses all the nodes,
especially since the end result is effectively a linked list,
where "head" usually means the first element.
I'd rename this to node.



All the curr.right = null; can be safely dropped,
because curr.right will either get overwritten with the intended value,
or it's null to begin with (in the very last node).



An \$O(n)\$ solution exists without using a stack:


When left is null and right is not, advance over right
When right is null and left is not, move left to right and advance over right
When both not null of node, then:


traverse through all the right descendants of node.left, and append at the end node.right
move node.left to node.right and advance over it