上一页 1 ··· 31 32 33 34 35 36 37 38 39 ··· 43 下一页

2015年7月21日

12. Integer to Roman (HashTable)

摘要: Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999. 思路:罗马数字共有七个,即I(1),V(5),X(10),L(50),C(100), 阅读全文

posted @ 2015-07-21 06:24 joannae 阅读(133) 评论(0) 推荐(0) 编辑

2015年7月20日

11.Container With Most Water (Array; Two-Pointers)

摘要: Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpo 阅读全文

posted @ 2015-07-20 20:30 joannae 阅读(137) 评论(0) 推荐(0) 编辑

2015年7月18日

10.Regular Expression Matching (String; Back-Track,DP)

摘要: Implement regular expression matching with support for '.' and '*'. '.' Matches any single character. '*' Matches zero or more of the preceding elemen 阅读全文

posted @ 2015-07-18 07:02 joannae 阅读(239) 评论(0) 推荐(0) 编辑

2015年7月16日

8.String to Integer (atoi) (INT; Overflow)

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

posted @ 2015-07-16 08:18 joannae 阅读(191) 评论(0) 推荐(0) 编辑

2015年7月15日

7.Reverse Integer (INT; Overflow)

摘要: Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321思路:要注意溢出。用以下做法,会溢出。class Solution {public: int reverse(in... 阅读全文

posted @ 2015-07-15 15:58 joannae 阅读(154) 评论(0) 推荐(0) 编辑

6.ZigZag Conversion(Graph, traverse)

摘要: 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 font 阅读全文

posted @ 2015-07-15 09:13 joannae 阅读(379) 评论(0) 推荐(0) 编辑

2015年7月14日

5.Longest Palindromic Substring (String; DP, KMP)

摘要: Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longes 阅读全文

posted @ 2015-07-14 09:14 joannae 阅读(247) 评论(0) 推荐(0) 编辑

2015年7月12日

4. Median of Two Sorted Arrays(Array; Divide-and-Conquer)

摘要: 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 sh 阅读全文

posted @ 2015-07-12 16:11 joannae 阅读(263) 评论(0) 推荐(0) 编辑

2015年7月11日

3.Longest Substring Without Repeating Characters(string; HashTable)

摘要: Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo 阅读全文

posted @ 2015-07-11 06:03 joannae 阅读(243) 评论(0) 推荐(0) 编辑

2015年7月10日

2.Add Two Numbers (List)

摘要: 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 single ... 阅读全文

posted @ 2015-07-10 19:35 joannae 阅读(148) 评论(0) 推荐(0) 编辑

上一页 1 ··· 31 32 33 34 35 36 37 38 39 ··· 43 下一页

导航