April01xxx

导航

2018年10月28日 #

字符串问题之最长真前缀,真后缀

摘要: 1.题目 === 好久没有写东西了,懈怠了.越来越觉得能坚持做一件时间,真的需要极大的毅力.这次是想把以前理解了的东西 形成文字记录下来.之前在LeetCode上刷题的时候,有些涉及到KMP算法的,当时查了写些料算是吃透了,但没记下 来,这次又遇到一个类似的问题,在想解法的时候,发现需要用到真前缀, 阅读全文

posted @ 2018-10-28 15:47 April01xxx 阅读(979) 评论(0) 推荐(1) 编辑

2018年7月28日 #

First Missing Positive

摘要: 1.题目 === Given an unsorted integer array, find the smallest missing positive integer. Note: Your algorithm should run in O(n) time and uses constant e 阅读全文

posted @ 2018-07-28 22:09 April01xxx 阅读(111) 评论(0) 推荐(0) 编辑

2018年7月22日 #

Substring with Concatenation of All Words

摘要: 1.题目 === You are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of substring(s) in s that i 阅读全文

posted @ 2018-07-22 17:06 April01xxx 阅读(92) 评论(0) 推荐(0) 编辑

2018年7月8日 #

ZigZag Conversion 之字形转换字符串

摘要: 1.题目 The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed 阅读全文

posted @ 2018-07-08 12:14 April01xxx 阅读(225) 评论(0) 推荐(0) 编辑

2018年7月7日 #

Longest Palindrome 最长回文串问题

摘要: 1.题目 Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. 题目的大意是求取给定字符串中最长的回文子串(palindr 阅读全文

posted @ 2018-07-07 21:35 April01xxx 阅读(297) 评论(0) 推荐(0) 编辑

2018年7月6日 #

Median of Two Sorted Arrays

摘要: 1.题目 最近开始做一些算法训练,感觉自己太鶸.来看看这个题目:给定两个已排序的数组,求其中位数 There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two 阅读全文

posted @ 2018-07-06 14:49 April01xxx 阅读(106) 评论(0) 推荐(0) 编辑

2018年6月30日 #

Python正则表达式

摘要: Python正则表达式中扩展表示法一时间难以完全消化,将自己的理解记录在此.扩展表达式是一种形如(?<pattern>)的模式,根据<pattern>的不同实现不同的语义,具体有以下几种: 负向后视断言,本例表达的含义是:要匹配的内容前面不是http或https 条件断言,本例表达的含义是:如果匹配 阅读全文

posted @ 2018-06-30 18:43 April01xxx 阅读(123) 评论(0) 推荐(0) 编辑

2018年6月27日 #

TCP连接笔记

摘要: 可靠的实现TCP全双工连接的终止 允许旧的重复分组在网络中消逝 指定端口没有正在监听的服务器 TCP想取消一个已有连接 TCP收到一个根本不存在的连接上的分节 阅读全文

posted @ 2018-06-27 21:33 April01xxx 阅读(72) 评论(0) 推荐(0) 编辑

2018年6月20日 #

python os.path.isfile函数

摘要: 最近刚开始学习Python,做了个小练习:扫描当前目录及其子目录中的文件,找出文件名中含有指定关键字的文件并打印文件名。思路很简单,如果是文件则判断是否满足条件;如果是目录则进入目录搜索文件,递归。 思路有了那就准备开撸 撸完测试,发现结果跟想象的不一样,遇到子目录后就退出了,通过调试发现递归函数返 阅读全文

posted @ 2018-06-20 09:57 April01xxx 阅读(1059) 评论(0) 推荐(1) 编辑