上一页 1 ··· 8 9 10 11 12 13 14 15 16 下一页

Leetcode: Minimum window substring

摘要: Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).For example,S="ADOBECODEBA... 阅读全文
posted @ 2014-10-04 16:56 Ryan-Xing 阅读(177) 评论(0) 推荐(0) 编辑

Word Ladder

摘要: Given two words (startandend), and a dictionary, find the length of shortest transformation sequence fromstarttoend, such that:Only one letter can be ... 阅读全文
posted @ 2014-10-03 23:48 Ryan-Xing 阅读(278) 评论(0) 推荐(0) 编辑

Namespace, string, vector and array

摘要: 1. Headers should not include using declarationCode inside headers ordinarily should not include using declarations. The reason is that the contents o... 阅读全文
posted @ 2014-10-03 16:52 Ryan-Xing 阅读(182) 评论(0) 推荐(0) 编辑

C++ Variables and Basic Types Notes

摘要: 1. Type conversion:If we assign an out-of-range value to an object of unsigned type, the result is the remainder of the value modulo the number of val... 阅读全文
posted @ 2014-10-03 15:37 Ryan-Xing 阅读(178) 评论(0) 推荐(0) 编辑

Insertion Sort List

摘要: Sort a linked list using insertion sort.分析:插入排序的过程是从第二个元素开始,将该元素插入到前面已拍好序的序列的正确位置。如果数据结构是单链表,则主要考察单链表的结点移动操作。将一个结点插入到另一个结点的前面,需要这两个结点的previous结点。特别要注意... 阅读全文
posted @ 2014-08-20 16:19 Ryan-Xing 阅读(144) 评论(0) 推荐(0) 编辑

Next Permutation

摘要: Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possibl... 阅读全文
posted @ 2014-08-19 00:14 Ryan-Xing 阅读(136) 评论(0) 推荐(0) 编辑

Palindrome Partitioning

摘要: Given a strings, partitionssuch that every substring of the partition is a palindrome.Return all possible palindrome partitioning ofs.For example, giv... 阅读全文
posted @ 2014-08-18 13:50 Ryan-Xing 阅读(123) 评论(0) 推荐(0) 编辑

Add Binary

摘要: Given two binary strings, return their sum (also a binary string).For example,a ="11"b ="1"Return"100".分析:该题需要注意的地方:1)两个string的长度可能不同 2)近位借鉴leetcode-c... 阅读全文
posted @ 2014-08-18 13:20 Ryan-Xing 阅读(161) 评论(0) 推荐(0) 编辑

Validate Binary Search Tree

摘要: Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains only n... 阅读全文
posted @ 2014-08-18 12:03 Ryan-Xing 阅读(120) 评论(0) 推荐(0) 编辑

Leetcode: Letter Combinations of a Phone Number

摘要: Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephon... 阅读全文
posted @ 2014-08-17 15:44 Ryan-Xing 阅读(151) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 15 16 下一页