上一页 1 2 3 4 5 6 ··· 8 下一页

2014年9月24日

leetcode - Median of Two Sorted Arrays

摘要: There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be ... 阅读全文

posted @ 2014-09-24 15:11 laihaiteng 阅读(133) 评论(0) 推荐(0) 编辑

2014年9月22日

leetcode - Search in Rotated Sorted Array I & II

摘要: Search in Rotated Sorted Array ISuppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e.,0 1 2 4 5 6 7might become4 5 6 7 0 1 2... 阅读全文

posted @ 2014-09-22 21:16 laihaiteng 阅读(192) 评论(0) 推荐(0) 编辑

2014年9月21日

leetcode - Remove Duplicates from Sorted Array I && II

摘要: Remove Duplicates from Sorted Array IGiven a sorted array, remove the duplicates in place such that each element appear onlyonceand return the new len... 阅读全文

posted @ 2014-09-21 13:23 laihaiteng 阅读(172) 评论(0) 推荐(0) 编辑

2014年9月14日

leetcode - Populating Next Right Pointers in Each Node I&II

摘要: Populating Next Right Pointers in Each Node IGiven a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; Tree... 阅读全文

posted @ 2014-09-14 21:26 laihaiteng 阅读(164) 评论(0) 推荐(0) 编辑

leetcode - Longest Palindromic Substring

摘要: Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest pa... 阅读全文

posted @ 2014-09-14 12:33 laihaiteng 阅读(145) 评论(0) 推荐(0) 编辑

2014年9月9日

leetcode - Add Binary

摘要: Given two binary strings, return their sum (also a binary string).For example,a ="11"b ="1"Return"100".字符串相加,不难个人思路:1,尾部对齐,然后逐位相加,flag记为进位代码: 1 #inclu... 阅读全文

posted @ 2014-09-09 11:35 laihaiteng 阅读(146) 评论(0) 推荐(0) 编辑

leetcode - String to Integer (atoi)

摘要: Implementatoito convert a string to an integer.Hint:Carefully consider all possible input cases. If you want a challenge, please do not see below and ... 阅读全文

posted @ 2014-09-09 10:40 laihaiteng 阅读(112) 评论(0) 推荐(0) 编辑

2014年9月8日

leetcode - Implement strStr()

摘要: Implement strStr().Returns a pointer to the first occurrence of needle in haystack, ornullif needle is not part of haystack.在文本串中查找模式串第一次出现的位置个人思路:1,暴... 阅读全文

posted @ 2014-09-08 14:38 laihaiteng 阅读(166) 评论(0) 推荐(0) 编辑

2014年9月7日

leetcode - Valid Palindrome

摘要: Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: Pana... 阅读全文

posted @ 2014-09-07 11:14 laihaiteng 阅读(141) 评论(0) 推荐(0) 编辑

2014年9月6日

leetcode - Reorder List

摘要: Given a singly linked listL: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 exam... 阅读全文

posted @ 2014-09-06 11:32 laihaiteng 阅读(168) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 ··· 8 下一页

导航