2016年4月26日

Reverse Linked List II

摘要: Reverse a linked list from position m to n. Do it in-place and in one-pass. For example:Given 1->2->3->4->5->NULL, m = 2 and n = 4, return 1->4->3->2- 阅读全文

posted @ 2016-04-26 21:46 Sheryl Wang 阅读(177) 评论(0) 推荐(0) 编辑

Longest Common Prefix

摘要: Write a function to find the longest common prefix string amongst an array of strings. 这是一道字符串的简单题.思路也非常简单,基本都是brute force的解法.具体解法分为:按列扫和按行扫两种. 按列扫,是每 阅读全文

posted @ 2016-04-26 10:23 Sheryl Wang 阅读(160) 评论(0) 推荐(0) 编辑

导航