12 2014 档案

摘要:题目描述: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 be... 阅读全文
posted @ 2014-12-28 16:49 Sawyer Ford 阅读(158) 评论(0) 推荐(0)
摘要:题目摘要:Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321 这道题不算难,主要是要考虑"反转后的值可能越界"这一种情况。(此题起初设计时,未考虑这种情况,因此网上很多旧... 阅读全文
posted @ 2014-12-22 11:28 Sawyer Ford 阅读(145) 评论(0) 推荐(0)
摘要:题目描述: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 @ 2014-12-19 19:54 Sawyer Ford 阅读(195) 评论(0) 推荐(0)
摘要:题目描述: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 l... 阅读全文
posted @ 2014-12-17 15:26 Sawyer Ford 阅读(202) 评论(0) 推荐(0)
摘要:使用递归可以非常方便地实现二叉树的遍历。如果不使用递归呢,请听我一一道来。首先给出二叉树遍历的递归版本:struct BTNode { char data; BTNode *lchild, *rchild;};void visit(BTNode *p){ coutdatalch... 阅读全文
posted @ 2014-12-12 19:55 Sawyer Ford 阅读(528) 评论(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 si... 阅读全文
posted @ 2014-12-11 14:37 Sawyer Ford 阅读(181) 评论(0) 推荐(0)
摘要:题目描述:Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating lette... 阅读全文
posted @ 2014-12-05 19:13 Sawyer Ford 阅读(169) 评论(0) 推荐(0)
摘要:题目描述: 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 sho... 阅读全文
posted @ 2014-12-02 17:28 Sawyer Ford 阅读(166) 评论(0) 推荐(0)