2015-09-09 [一点资讯]--数据抓取和处理工程师--1面

时间:2015-09-09 10:00 ~ 11:00

地点:北京市海淀区王庄路1号 清华同方科技广场D座 西区 7层

 

1. 实现链表加法

链接:https://github.com/loverszhaokai/ALG/blob/master/src/add_long.cc

两次反转。

// Reverse a list
// E.g. 1->2->3 after reverse is: 3->2->1
static ListNode *reverse(ListNode *head)
{
    ListNode $head)
istNode =end: /span *he;
    Liiiiind: stNode /span">he =="t
方科< x *revers;
    Liiiii *reversestNode =="t
方科< xnd: ;
    Liiiiind: estNode =="t
方科< x">head)
{
    Li}
    ListNode $statistNode $
方科< xistN)    LiiiiistNode $

方科< x is: 3-&nd: 1matic: tnd: 2 stNode =="t
方科< x is: 3-&nd: 2){
    Lic ListNodeorig_nd: 1 =="t
方科< xnd: 1;    Lic ListNodeorig_nd: 2 =="t
方科< xnd: 2{
    Lic pseudo_nd: (反转。

he is thex ialind: stNode Lic e *reverse(L&="t 方科< pseudo_nd: ; Lic ListNode *$
$$
he =="t 方科< x"ers; tatiiiii *reversestNode =="t 方科< xvers; Liiiii.g.o1 stNode =end: 1/span *he; Liiiii.g.o2 stNode =end: 2/span *he; Li} ListNode $$
he =="t 方科< x"ers; tatiiiii *reversestNode =="t 方科< xvers; Liiiii.g.o1 stNode =end: 1/span *he; Li} ListNode $$
he =="t 方科< x"ers; tatiiiii *reversestNode =="t 方科< xvers; Liiiii.g.o2 stNode =end: 2/span *he; Li} ListNode $
$
he =="t 方科< x"ers; tati} ListNode $两次反转。

he is thex ialind: stNode Li$he){ }ang="EN-USre> id="blog_nbsp;西区