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,没法操作
相关阅读
哪位大侠指点一下如何准备on site presentation?C++ Engineer job in Chicago,IL发个题目给大家复习一下marcobloomberg onsite完了要写thank you letter吗?opt生效前3周开始工作csdn里边下载需要的资源分从哪得?一道面试算法题请问一下H1B的这个名额限制OPT case update数据结构和算法,应该看哪本书?大家有没有在看到公司安排的面试程序时心里发毛?Job oppotunity in NYC,请尽快投简历~opt unemployment 从甚末时候开始算?请问google要freeze是不是真的???投简历一般多长时间会有消息,还有postdoc经历好还是scientist经历好博士和硕士本科的区别拿到offer可以送recruiter礼物么Polysilicon Technology Lead 这个title看起来ok吗Human resource必须要我有了EAD card才发offer....Onsite 后的感谢信,一般有回信吗? (转载)