public void reverse()
{
p = null;
q = first;
while(q!=null)
{
first = first.next;
q.next = p;
p = q;
q = first;
}
first = p;
}
给定不带头节点的单链表头指针,设计算法将其逆置(Java实现)
最新推荐文章于 2023-07-12 16:59:39 发布