上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 23 下一页
摘要: There are n coins in a line. Two players take turns to take one or two coins from right side until there are no more coins left. The player who take t 阅读全文
posted @ 2016-03-15 13:33 哥布林工程师 阅读(130) 评论(0) 推荐(0) 编辑
摘要: Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors. 思路: 分为两步 1. BFS,新建所有图中的node,用一个HashMap建立原来node和新的node之 阅读全文
posted @ 2016-03-15 13:20 哥布林工程师 阅读(184) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and 阅读全文
posted @ 2016-03-15 12:18 哥布林工程师 阅读(172) 评论(0) 推荐(0) 编辑
摘要: Design an algorithm and write code to serialize and deserialize a binary tree. Writing the tree to a file is called 'serialization' and reading back f 阅读全文
posted @ 2016-03-15 11:43 哥布林工程师 阅读(150) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find the maximum path sum. The path may start and end at any node in the tree. Given the below binary tree: return 6.   一个二叉树的最大量 阅读全文
posted @ 2016-03-15 06:29 哥布林工程师 阅读(216) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root). Give 阅读全文
posted @ 2016-03-14 17:19 哥布林工程师 阅读(154) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).   Given binary tree {3,9,20,#,#, 阅读全文
posted @ 2016-03-14 17:10 哥布林工程师 阅读(134) 评论(0) 推荐(0) 编辑
摘要: Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may comple 阅读全文
posted @ 2016-03-14 16:48 哥布林工程师 阅读(184) 评论(0) 推荐(0) 编辑
摘要: Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may comple 阅读全文
posted @ 2016-03-14 16:37 哥布林工程师 阅读(119) 评论(0) 推荐(0) 编辑
摘要: Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction 阅读全文
posted @ 2016-03-14 16:31 哥布林工程师 阅读(158) 评论(0) 推荐(0) 编辑
上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 23 下一页