随笔分类 -  链表

摘要:注意插入和删除操作中的限制约束条件。class ListNode { ListNode next; int val; public ListNode(int x) { val = x; }}public class LinkList { private L... 阅读全文
posted @ 2015-10-05 22:08 lasclocker 阅读(259) 评论(0) 推荐(0)
摘要:打印链表元素的顺序与尾插入法的相反,但代码比尾插入法更简洁。class ListNode { ListNode next; int val; public ListNode(int x) { val = x; }}public class LinkList { ... 阅读全文
posted @ 2015-10-05 20:51 lasclocker 阅读(447) 评论(0) 推荐(0)
摘要:class ListNode { ListNode next; int val; public ListNode(int x) { val = x; }}public class LinkList { private ListNode curr = new... 阅读全文
posted @ 2015-10-05 20:44 lasclocker 阅读(543) 评论(0) 推荐(0)
摘要:/* * three argvs: headNext(the head's next), tmp(move forward), node(the removed ListNode). */ public ListNode reverseList(ListNode ... 阅读全文
posted @ 2015-07-05 17:15 lasclocker 阅读(121) 评论(0) 推荐(0)