When to use the Stack collection in C#?

后端 未结 12 2312
滥情空心
滥情空心 2021-02-14 20:44

I do understand how Stack() and Stack works, but I really can\'t see any scenarios where an array, List or IEnumer

12条回答
  •  一个人的身影
    2021-02-14 21:01

    Stacks are frequently used in text parsing algorithms, such as the evaluation of "4+5+6". For a real-world example of an application that uses stacks to parse text, see HTMLAgilityPack. This component is used to parse HTML, and it includes the source code, so you can see how and where stacks are used...

提交回复
热议问题