在C# 中, 广义表结构如: public enum NodeType { Atom, List } public class GLNode<T> { public NodeType Type { get; set; } public GLNode<T> Next { get; set; } public object Item { get; set;} //Save list or T in it by Type. public GLNode() { this.Next = null; } } 广义表的相关操作: 1. 广义表的创建 2. 广义表的输出 3. 广义表的深度 4. 广义表的反序 所有功能是有递归来实现。 不废话了, 具体代码如下: public class GL { public GLNode<char> _Root; private char[] _CharArray; private int i = 0;//for create GLNode by recursion. public GL(string item) { this._CharArray = item.ToCharArray(); } public int Depth { get { return GetDepth(this._Root); } } public GLNode<char> Create() { GLNode<char> node=null; char t = this._CharArray[i++]; if (i <= this._CharArray.Length) { node = new GLNode<char>(); switch (t) { case '(': node.Type