摘要: Given a sorted linked list, delete all nodes that have duplicate numbers, leaving onlydistinctnumbers from the original list.For example,Given1->2->3-... 阅读全文
posted @ 2014-05-20 23:42 小菜刷题史 阅读(143) 评论(0) 推荐(0) 编辑
摘要: Reverse a linked list from positionmton. Do it in-place and in one-pass.For example:Given1->2->3->4->5->NULL,m= 2 andn= 4,return1->4->3->2->5->NULL.No... 阅读全文
posted @ 2014-05-20 22:44 小菜刷题史 阅读(132) 评论(0) 推荐(0) 编辑
摘要: Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximu... 阅读全文
posted @ 2014-05-20 18:33 小菜刷题史 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 链表结点类型定义:1 class Node {2 public:3 int data = 0;4 Node *next = nullptr;5 6 Node(int d) {7 data = d;8 }9 };快行指针(runner)技巧:同时... 阅读全文
posted @ 2014-05-20 18:13 小菜刷题史 阅读(352) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For example:Given the below binary tree andsum =... 阅读全文
posted @ 2014-05-20 12:31 小菜刷题史 阅读(138) 评论(0) 推荐(0) 编辑
摘要: Given a stringsconsists of upper/lower-case alphabets and empty space characters' ', return the length of last word in the string.If the last word doe... 阅读全文
posted @ 2014-05-20 12:10 小菜刷题史 阅读(97) 评论(0) 推荐(0) 编辑
摘要: Given a linked list and a valuex, partition it such that all nodes less thanxcome before nodes greater than or equal tox.You should preserve the origi... 阅读全文
posted @ 2014-05-20 11:51 小菜刷题史 阅读(135) 评论(0) 推荐(0) 编辑