Question: We have all read about or heard about the stack class, but many of us have probably never found a reason to use the LIFO object. I am curious to hear of real world solutions that used this object and why. 

<http://msdn.microsoft.com/en-us/library/system.collections.stack.aspx>

I recently saw an example where a programmer used a stack to keep track of his current position while traversing a hierarchical data source. As he moved down the hierarchy, he pushed his position identifier on to the stack and as he moved back up he popped items off the stack. I thought this was a very efficent way to keep track of his current position in a mamoth hierarchy. I had never seen this before.

Anyone else have any examples?

Answer: 
If you have a recursive algorithm, you can typically rewrite them using a stack. (since recursive algorithms implicitly already use a stack)
Here's an implementation of a deep compare where a Stack is used to keep track of the path to the current object being compared. 

[C# implementation of deep/recursive object comparison in .net 3.5](https://stackoverflow.com/questions/1539989/c-implementation-of-deep-recursive-object-comparison-in-net-3-5/1540309#1540309)

I've also used it in similar types of code working with generating xpath statements for particular xml nodes.