摘要:
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... 阅读全文
摘要:
Given two words (startandend), and a dictionary, find the length of shortest transformation sequence fromstarttoend, such that:Only one letter can be ... 阅读全文
摘要:
1. Headers should not include using declarationCode inside headers ordinarily should not include using declarations. The reason is that the contents o... 阅读全文
摘要:
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... 阅读全文
摘要:
Sort a linked list using insertion sort.分析:插入排序的过程是从第二个元素开始,将该元素插入到前面已拍好序的序列的正确位置。如果数据结构是单链表,则主要考察单链表的结点移动操作。将一个结点插入到另一个结点的前面,需要这两个结点的previous结点。特别要注意... 阅读全文
摘要:
Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possibl... 阅读全文
摘要:
Given a strings, partitionssuch that every substring of the partition is a palindrome.Return all possible palindrome partitioning ofs.For example, giv... 阅读全文
摘要:
Given two binary strings, return their sum (also a binary string).For example,a ="11"b ="1"Return"100".分析:该题需要注意的地方:1)两个string的长度可能不同 2)近位借鉴leetcode-c... 阅读全文
摘要:
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... 阅读全文
摘要:
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... 阅读全文