2016年4月12日

摘要: Given a list of unique words. Find all pairs of distinct indices (i, j) in the given list, so that the concatenation of the two words, i.e. words[i] + 阅读全文

posted @ 2016-04-12 16:34 徐岩 阅读(541) 评论(0) 推荐(0)

摘要: Given an integer matrix, find the length of the longest increasing path. From each cell, you can either move to four directions: left, right, up or do 阅读全文

posted @ 2016-04-12 14:53 徐岩 阅读(116) 评论(0) 推荐(0)

摘要: Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpo 阅读全文

posted @ 2016-04-12 14:51 徐岩 阅读(105) 评论(0) 推荐(0)

摘要: Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999. Solution 1: 阅读全文

posted @ 2016-04-12 14:36 徐岩 阅读(104) 评论(0) 推荐(0)

摘要: Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. roman numerals: https://en.wikipedia.org/w 阅读全文

posted @ 2016-04-12 14:27 徐岩 阅读(108) 评论(0) 推荐(0)

摘要: Given a binary tree, return the inorder traversal of its nodes' values. For example:Given binary tree {1,#,2,3}, return [1,3,2]. Solution 1: Solution 阅读全文

posted @ 2016-04-12 11:20 徐岩 阅读(99) 评论(0) 推荐(0)

摘要: Given a binary tree, return the preorder traversal of its nodes' values. For example:Given binary tree {1,#,2,3}, return [1,2,3]. Solution 1: (递归) Sol 阅读全文

posted @ 2016-04-12 11:17 徐岩 阅读(99) 评论(0) 推荐(0)

摘要: 阅读全文

posted @ 2016-04-12 11:08 徐岩 阅读(101) 评论(0) 推荐(0)

摘要: 参考书:图论算法理论、实现及应用(北京大学出版社) 输入数据:(test.txt) 程序: 阅读全文

posted @ 2016-04-12 10:48 徐岩 阅读(1582) 评论(0) 推荐(0)