上一页 1 2 3 4 5 6 7 8 ··· 16 下一页
摘要: Implement strStr(). Returns a pointer to the first occurrence of needle in haystack, or null if needle is not part of haystack. Solution: Brute force ... 阅读全文
posted @ 2014-04-23 04:48 beehard 阅读(143) 评论(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 longe... 阅读全文
posted @ 2014-04-23 03:44 beehard 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 1 /** 2 * Definition for binary tree with next pointer. 3 * struct TreeLinkNode { 4 * int val; 5 * TreeLinkNode *left, *right, *next; 6 * Tre... 阅读全文
posted @ 2014-04-22 12:53 beehard 阅读(134) 评论(0) 推荐(0) 编辑
摘要: Sort a linked list in O(nlogn) time using constant space complexity. 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int... 阅读全文
posted @ 2014-04-22 07:12 beehard 阅读(155) 评论(0) 推荐(0) 编辑
摘要: There are N children standing in a line. Each child is assigned a rating value. You are giving candies to these children subjected to the following re... 阅读全文
posted @ 2014-04-22 06:23 beehard 阅读(184) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, flatten it to a linked list in-place. For example, Given 1 / \ 2 5 / \ \ 3 4 6 The flattened tree should look l... 阅读全文
posted @ 2014-04-22 05:50 beehard 阅读(131) 评论(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 font ... 阅读全文
posted @ 2014-04-22 04:57 beehard 阅读(182) 评论(0) 推荐(0) 编辑
摘要: Given a list, rotate the list to the right by k places, where k is non-negative. For example: Given 1->2->3->4->5->NULL and k = 2, return 4->5->1->2->... 阅读全文
posted @ 2014-04-22 04:06 beehard 阅读(124) 评论(0) 推荐(0) 编辑
摘要: Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example, "A man, a plan, a canal: Pa... 阅读全文
posted @ 2014-04-22 03:47 beehard 阅读(144) 评论(0) 推荐(0) 编辑
摘要: Given inorder and postorder traversal of a tree, construct the binary tree. Note: You may assume that duplicates do not exist in the tree. Solution: R... 阅读全文
posted @ 2014-04-20 07:01 beehard 阅读(139) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 16 下一页