04 2015 档案

摘要:题目:there are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the two sorted arrays.The overall run time complexity s... 阅读全文
posted @ 2015-04-30 21:53 第八片叶子 阅读(315) 评论(0) 推荐(0)
摘要:原题:Given a string, find the length of the longest substring without repeating characterFor example, the Longest substring without repeating letters fo... 阅读全文
posted @ 2015-04-25 21:45 第八片叶子 阅读(137) 评论(0) 推荐(0)
摘要:原题:You are given two linked lists representing two non-negative numbers.The digits are stored in reverse order and each of their nodes contain a singl... 阅读全文
posted @ 2015-04-24 22:11 第八片叶子 阅读(179) 评论(0) 推荐(0)
摘要:所有字符串匹配算法的核心问题是,当出现不匹配时,如何向后移动模式串一、暴力匹配算法 如果要匹配一个字符串s 和一个模式串p,则从i=0开始依次匹配s[i:(i+len(p))],简单粗暴,代码如下:def matcher(t, p): # param t: the string to chec... 阅读全文
posted @ 2015-04-13 21:58 第八片叶子 阅读(1939) 评论(0) 推荐(0)