摘要: 描述Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoringcases.For example,”A man, a plan, a canal: Pan 阅读全文
posted @ 2018-06-11 22:49 昵称真难想 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 描述Given an array of integers, every element appears three times except for one. Find that single one.Note: Your algorithm should have a linear runtime 阅读全文
posted @ 2018-06-11 17:33 昵称真难想 阅读(101) 评论(0) 推荐(0) 编辑
摘要: Single Number描述Given an array of integers, every element appears twice except for one. Find that single one.Note: Your algorithm should have a linear 阅读全文
posted @ 2018-06-11 17:04 昵称真难想 阅读(88) 评论(0) 推荐(0) 编辑
摘要: 描述Follow up for ”Search in Rotated Sorted Array”: What if duplicates are allowed?Would this affect the run-time complexity? How and why?Write a functi 阅读全文
posted @ 2018-06-11 15:56 昵称真难想 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 描述Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).You are given a target va 阅读全文
posted @ 2018-06-11 15:46 昵称真难想 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 描述Given a sorted array, remove the duplicates in place such that each element appear onlyonce and return the new length.Do not allocate extra space fo 阅读全文
posted @ 2018-06-11 15:22 昵称真难想 阅读(77) 评论(0) 推荐(0) 编辑
摘要: Remove Duplicates from Sorted Array II描述Follow up for ”Remove Duplicates”: What if duplicates are allowed at most twice?For example, Given sorted arra 阅读全文
posted @ 2018-06-11 15:00 昵称真难想 阅读(94) 评论(0) 推荐(0) 编辑
摘要: 描述The gray code is a binary numeral system where two successive values differ in only one bit. Given a non-negative integer n representing the total n 阅读全文
posted @ 2018-06-10 23:44 昵称真难想 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 两排序好的数组,找中位数 描述There are two sorted arrays A and B of size m and n respectively. Find the median of the two sortedarrays. The overall run time complex 阅读全文
posted @ 2018-06-10 15:19 昵称真难想 阅读(192) 评论(0) 推荐(0) 编辑
摘要: (转载) 按位与运算符(&) 参加运算的两个数据,按二进制位进行“与”运算。 运算规则:0&0=0; 0&1=0; 1&0=0; 1&1=1; 即:两位同时为“1”,结果才为“1”,否则为0 例如:3&5 即 0000 0011 & 0000 0101 = 0000 0001 因此,3&5的值得1。 阅读全文
posted @ 2018-06-10 15:01 昵称真难想 阅读(13891) 评论(0) 推荐(1) 编辑