2014年9月4日

Partition List

摘要: Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should preserve the 阅读全文

posted @ 2014-09-04 10:50 bug睡的略爽 阅读(138) 评论(0) 推荐(0) 编辑

Reorder List

摘要: Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You must do this in-place without altering the nodes' values. For 阅读全文

posted @ 2014-09-04 10:31 bug睡的略爽 阅读(137) 评论(0) 推荐(0) 编辑

Longest Common Prefix

摘要: Write a function to find the longest common prefix string amongst an array of strings. 这题很简单,直接依次比较即可,代码如下: 1 class Solution { 2 public: 3 string long 阅读全文

posted @ 2014-09-04 10:04 bug睡的略爽 阅读(140) 评论(0) 推荐(0) 编辑

导航