上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 25 下一页
摘要: Eva loves to collect coins from all over the universe, including some other planets like Mars. One day she visited a universal shopping mall which cou 阅读全文
posted @ 2018-06-22 20:36 赖兴宇 阅读(115) 评论(0) 推荐(0) 编辑
摘要: The "eight queens puzzle" is the problem of placing eight chess queens on an 8×8 chessboard so that no two queens threaten each other. Thus, a solutio 阅读全文
posted @ 2018-06-22 20:22 赖兴宇 阅读(170) 评论(0) 推荐(0) 编辑
摘要: Shopping in Mars is quite a different experience. The Mars people pay by chained diamonds. Each diamond has a value (in Mars dollars M\$). When making 阅读全文
posted @ 2018-06-22 19:08 赖兴宇 阅读(123) 评论(0) 推荐(0) 编辑
摘要: Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to ou 阅读全文
posted @ 2018-06-22 16:51 赖兴宇 阅读(143) 评论(0) 推荐(0) 编辑
摘要: Suppose that all the keys in a binary tree are distinct positive integers. A unique binary tree can be determined by a given pair of postorder and ino 阅读全文
posted @ 2018-06-22 16:33 赖兴宇 阅读(268) 评论(0) 推荐(0) 编辑
摘要: The following is from Max Howell @twitter: Google: 90% of our engineers use the software you wrote (Homebrew), but you can't invert a binary tree on a 阅读全文
posted @ 2018-06-22 15:09 赖兴宇 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 给定一个三角形,找出自顶向下的最小路径和。每一步只能移动到下一行中相邻的结点上。 例如,给定三角形: 自顶向下的最小路径和为 11(即,2 + 3 + 5 + 1 = 11)。 说明: 如果你可以只使用 O(n) 的额外空间(n 为三角形的总行数)来解决这个问题,那么你的算法会很加分。 dp1[i] 阅读全文
posted @ 2018-06-22 13:34 赖兴宇 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 一条包含字母 A-Z 的消息通过以下方式进行了编码: 给定一个只包含数字的非空字符串,请计算解码方法的总数。 示例 1: 示例 2: 阅读全文
posted @ 2018-06-21 23:04 赖兴宇 阅读(229) 评论(0) 推荐(0) 编辑
摘要: 给定一个包含非负整数的 m x n 网格,请找出一条从左上角到右下角的路径,使得路径上的数字总和为最小。 说明:每次只能向下或者向右移动一步。 示例: 阅读全文
posted @ 2018-06-21 21:01 赖兴宇 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 一个机器人位于一个 m x n 网格的左上角 (起始点在下图中标记为“Start” )。 机器人每次只能向下或者向右移动一步。机器人试图达到网格的右下角(在下图中标记为“Finish”)。 现在考虑网格中有障碍物。那么从左上角到右下角将会有多少条不同的路径? 网格中的障碍物和空位置分别用 1 和 0 阅读全文
posted @ 2018-06-21 20:48 赖兴宇 阅读(228) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 25 下一页