If one of the stacks is empty means other stack has extra leaves so return false
if ( s1 . Count == 0 s2 . Count == 0 ) { return false ; } Node temp1 = s1 . Pop ( ) ; while ( temp1 != null && ! temp1 . Leaf ) {