f*i
2 楼
public static LinkList deleteLastIndex(LinkList root)
{
if (root == null || root.next == null)
return null;
LinkList returnRoot = root, nextNode = root.next;
while (nextNode.next != null)
{
nextNode = nextNode.next;
root = root.next;
}
root.next = null;
return returnRoot;
}
{
if (root == null || root.next == null)
return null;
LinkList returnRoot = root, nextNode = root.next;
while (nextNode.next != null)
{
nextNode = nextNode.next;
root = root.next;
}
root.next = null;
return returnRoot;
}
b*4
3 楼
f*i
4 楼
直接指向null不行吗?
w*x
6 楼
没法删,你不是自己想出来的题吧
i*7
11 楼
crack coding interview上说过了。这种情况下是无解的。不用想了。。
f*2
13 楼
只知道最后一个节点,如果是单链表,无法删除。删除实质上是隔离前一个节点和这个
节点的link,如果不能得到这个link,没法操作
节点的link,如果不能得到这个link,没法操作
相关阅读
JAVA developer with Hibernate for a client in Downtown Seattle求鉴定找工作方案可行性包子请问一般公司的freeze period是多久求推荐一个容易过的online学历的学校onsite前问小秘要见的人的名字和title收到phd申请的phone interview 邀请,求意见。明天面老中,考虑差不多就放水Bloomberg家面intern也要onsite了啊?假如leetcode出实体书除了Amazon,哪家还会出OOD的问题啊?码工找工作有被要求提交sample code来证明自己能力的么?patent agent (生物类)非常勿扰 美国西海岸专场开播了,一共四期[合集] 哪里工作更好?Google与Facebook大对比[转]请问phone interview该怎么选时间?求BB内推迷茫。。 失望。。 被奇怪的理由拒了。。。 哎。。 实在不行就回国了,心灰意冷打算圣诞节哪都不去玩,就把leetcode做3遍问一个排序的问题下周第一个on site, 求bless