// 链表类
class LL
{
public string value;
public LL link;
// used for outputing the link data
public void OutPut()
{
Console.Write(value);
if (link != null)
{
Console.Write(",");
link.OutPut();
}
}
}
逆序:
private LL Revert(LL t)
{
LL newList = null;
while (t != null)
{
LL mid = new LL();
mid.value = t.value;
mid.link = newList;
newList = mid;
t = t.link;
}
return newList;
}
全部代码:










































































