摘要: 今天去昆仑在线笔试,其中一题是写一个单链表逆置函数,节点如下: struct Node { int Value; Node *next; }; 之前还真没有写过,只好想了个笨办法了。结构体比较简单,那只交换value的值好了。 Node *getByNum(int n,Node* head) { int i=0; while(n--) { if(head->next != NULL) head =... 阅读全文
posted @ 2011-03-28 18:14 Record drip 阅读(654) 评论(0) 推荐(0) 编辑