這個二級單鏈表只包括一些head
public class Link
{
public Link Next;
public int Data;
public Link(Link next
{
this
this
}
}
public class CascadeLink
{
public Link Next;
public CascadeLink NextHead;
public CascadeLink(CascadeLink nextHead
{
this
this
}
}
下面做一個二級單鏈表
public static CascadeLink GenerateCascadeLink()
{
Link head
Link head
Link head
CascadeLink element
CascadeLink element
CascadeLink element
CascadeLink head = new CascadeLink(element
return head;
}
就是說
–>
我們的算法思想是
public static Link GenerateNewLink(CascadeLink head)
{
CascadeLink curr
Link newHead = curr
Link curr
while (curr
{
curr
while (curr
{
curr
}
curr
}
return newHead;
}
其中
From:http://tw.wingwit.com/Article/program/sjjg/201405/30938.html