/algorithm-campus

Lintcode examination source code

Primary LanguageJavaMIT LicenseMIT

algorithm-campus

lintcode 上的算法提答案,现包括 Java, C++, Python 的解答。

答题进度

Week 1

Week 2

Week 3

67-二叉树的中序遍历(http://www.lintcode.com/problem/binary-tree-inorder-traversal)
480-二叉树的所有路径(http://www.lintcode.com/problem/binary-tree-paths)
68-二叉树的后序遍历(http://www.lintcode.com/problem/binary-tree-postorder-traversal)
66-二叉树的前序遍历(http://www.lintcode.com/problem/binary-tree-preorder-traversal)

迎春特别系列

111-爬楼梯(http://www.lintcode.com/zh-cn/problem/climbing-stairs/)
55-比较字符串(http://www.lintcode.com/zh-cn/problem/compare-strings/)
177-把排序数组转换为高度最小的二叉搜索树(http://www.lintcode.com/zh-cn/problem/convert-sorted-array-to-binary-search-tree-with-minimal-height/)
445-Cosine Similarity(http://www.lintcode.com/zh-cn/problem/cosine-similarity/)
365-二进制中有多少个1(http://www.lintcode.com/zh-cn/problem/count-1-in-binary/)
420-报数(http://www.lintcode.com/zh-cn/problem/count-and-say/)
372-在O(1)时间复杂度删除表节点(http://www.lintcode.com/zh-cn/problem/delete-node-in-the-middle-of-singly-linked-list/)
14-二分查找(http://www.lintcode.com/zh-cn/problem/first-position-of-target/)
9-Fizz Buzz问题(http://www.lintcode.com/zh-cn/problem/fizz-buzz/)
453-将二叉树拆成链表(http://www.lintcode.com/zh-cn/problem/flatten-binary-tree-to-linked-list/)

Week 5

181-将整数 A 转换为 B(http://www.lintcode.com/zh-cn/problem/flip-bits/)
488-快乐数(http://www.lintcode.com/zh-cn/problem/happy-number/)
128-哈希函数(http://www.lintcode.com/zh-cn/problem/hash-function/)
469-等价二叉树(http://www.lintcode.com/zh-cn/problem/identical-binary-tree/)
30-插入区间(http://www.lintcode.com/problem/insert-interval)

Week 6

85-在二叉树中插入节点(http://www.lintcode.com/zh-cn/problem/insert-node-in-a-binary-search-tree/)
173-链表插入排序(http://www.lintcode.com/zh-cn/problem/insertion-sort-list/)
175-反转二叉树(http://www.lintcode.com/zh-cn/problem/invert-binary-tree/)
422-最后一个单词的长度(http://www.lintcode.com/zh-cn/problem/length-of-last-word/)
397-最长上升连续子序列(http://www.lintcode.com/zh-cn/problem/longest-increasing-continuous-subsequence/)

Week 7

133-最长单词(http://www.lintcode.com/zh-cn/problem/longest-words/)
46-主元素(http://www.lintcode.com/zh-cn/problem/majority-number/)
185-矩阵的之字型遍历(http://www.lintcode.com/zh-cn/problem/matrix-zigzag-traversal/)
97-二叉树的最大深度(http://www.lintcode.com/zh-cn/problem/maximum-depth-of-binary-tree/)
41-最大子数组(http://www.lintcode.com/zh-cn/problem/maximum-subarray/)

Week 8

80-中位数(http://www.lintcode.com/zh-cn/problem/median/)
156-合并区间(http://www.lintcode.com/zh-cn/problem/merge-intervals/)
64-合并排序数组 II(http://www.lintcode.com/zh-cn/problem/merge-sorted-array/)
6-合并排序数组(http://www.lintcode.com/zh-cn/problem/merge-sorted-array-ii/)
165-合并两个排序链表(http://www.lintcode.com/zh-cn/problem/merge-two-sorted-lists/)

Week 9

155-二叉树的最小深度(http://www.lintcode.com/zh-cn/problem/minimum-depth-of-binary-tree/)
110-最小路径和(http://www.lintcode.com/zh-cn/problem/minimum-path-sum/)
44-最小子数组(http://www.lintcode.com/zh-cn/problem/minimum-subarray/)
166-链表倒数第n个节点(http://www.lintcode.com/zh-cn/problem/nth-to-last-node-in-list/)
433-岛屿的个数(http://www.lintcode.com/zh-cn/problem/number-of-islands/)

Week 10

142-O(1)时间检测2的幂次(http://www.lintcode.com/problem/o1-check-power-of-2)
514-Paint Fence(http://www.lintcode.com/problem/paint-fence)
373-奇偶分割数组(http://www.lintcode.com/problem/partition-array-by-odd-and-even)
96-链表划分(http://www.lintcode.com/problem/partition-list)
197-排列序号(http://www.lintcode.com/problem/permutation-index)

Week 11

407-加一(http://www.lintcode.com/zh-cn/problem/plus-one/)
50-数组剔除元素后的乘积(http://www.lintcode.com/zh-cn/problem/product-of-array-exclude-itself/)
39-恢复旋转排序数组(http://www.lintcode.com/problem/recover-rotated-sorted-array)
100-删除排序数组中的重复数字(http://www.lintcode.com/zh-cn/problem/remove-duplicates-from-sorted-array/)
101-删除排序数组中的重复数字 II(http://www.lintcode.com/zh-cn/problem/remove-duplicates-from-sorted-array-ii/)

Week 12

112-删除排序链表中的重复元素(http://www.lintcode.com/zh-cn/problem/remove-duplicates-from-sorted-list/)
172-删除元素(http://www.lintcode.com/zh-cn/problem/remove-element/)
174-删除链表中倒数第n个节点(http://www.lintcode.com/zh-cn/problem/remove-nth-node-from-end-of-list/)
413-反转整数(http://www.lintcode.com/zh-cn/problem/reverse-integer/)
35-翻转链表(http://www.lintcode.com/zh-cn/problem/reverse-linked-list/)

Week 13

53-翻转字符串(http://www.lintcode.com/zh-cn/problem/reverse-words-in-a-string/)
8-旋转字符串(http://www.lintcode.com/zh-cn/problem/rotate-string/)
60-搜索插入位置(http://www.lintcode.com/zh-cn/problem/search-insert-position/)
28-搜索二维矩阵(http://www.lintcode.com/zh-cn/problem/search-a-2d-matrix/)
82-落单的数(http://www.lintcode.com/zh-cn/problem/single-number/)

Week 14

204-单例(http://www.lintcode.com/zh-cn/problem/singleton/)
212-空格替换http://www.lintcode.com/zh-cn/problem/space-replacement/()
141-X的平方根(http://www.lintcode.com/zh-cn/problem/sqrtx/)
138-子数组之和(http://www.lintcode.com/zh-cn/problem/subarray-sum/)
245-子树(http://www.lintcode.com/zh-cn/problem/subtree/)

Week15

524-Left Pad(http://www.lintcode.com/zh-cn/problem/left-pad/)
497-Shape Factory(http://www.lintcode.com/zh-cn/problem/shape-factory/)
451-两两交换链表中的节点(http://www.lintcode.com/zh-cn/problem/swap-nodes-in-pairs/)
496-Toy Factory(http://www.lintcode.com/zh-cn/problem/toy-factory/)
2-尾部的零(http://www.lintcode.com/zh-cn/problem/trailing-zeros/)

Week16

109-数字三角形(http://www.lintcode.com/zh-cn/problem/triangle/)
158-两个字符串是变位词(http://www.lintcode.com/zh-cn/problem/two-strings-are-anagrams/)
517-丑数(http://www.lintcode.com/zh-cn/problem/ugly-number/)
157-判断字符串是否没有重复字符(http://www.lintcode.com/zh-cn/problem/unique-characters/)
114-不同的路径(http://www.lintcode.com/zh-cn/problem/unique-paths/)

Week17

115-不同的路径II(http://www.lintcode.com/zh-cn/problem/unique-paths-ii/)
415-有效回文串(http://www.lintcode.com/problem/valid-palindrome)
423-有效的括号序列(http://www.lintcode.com/problem/valid-parentheses)
389-判断数独是否合法(http://www.lintcode.com/problem/valid-sudoku)
13-字符串查找(http://www.lintcode.com/zh-cn/problem/strstr/)