摘要: We are playing the Guess Game. The game is as follows: I pick a number from 1 to n. You have to guess which number I picked. Every time you guess wron 阅读全文
posted @ 2017-02-28 12:06 CodesKiller 阅读(143) 评论(0) 推荐(0) 编辑
摘要: Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in or 阅读全文
posted @ 2017-02-28 11:48 CodesKiller 阅读(144) 评论(0) 推荐(0) 编辑
摘要: You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality c 阅读全文
posted @ 2017-02-28 11:11 CodesKiller 阅读(80) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers sorted in ascending order, find the starting and ending position of a given target value. Your algorithm's runtime complexi 阅读全文
posted @ 2017-02-28 11:06 CodesKiller 阅读(127) 评论(0) 推荐(0) 编辑
摘要: Given inorder and postorder traversal of a tree, construct the binary tree. Note:You may assume that duplicates do not exist in the tree. 本题和之前的105题比较 阅读全文
posted @ 2017-02-28 07:19 CodesKiller 阅读(115) 评论(0) 推荐(0) 编辑
摘要: Given preorder and inorder traversal of a tree, construct the binary tree. Note:You may assume that duplicates do not exist in the tree. 本题通过前序和中序来推断这 阅读全文
posted @ 2017-02-28 06:52 CodesKiller 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 一般实际生活中我们遇到的算法分为四类: 一>判定性问题 二>最优化问题 三>构造性问题 四>计算性问题 而今天所要总结的算法就是着重解决 最优化问题 《算法之道》对三种算法进行了归纳总结,如下表所示: 标准分治 动态规划 贪心算法 适用类型 通用问题 优化问题 优化问题 子问题结构 每个子问题不同 阅读全文
posted @ 2017-02-28 06:46 CodesKiller 阅读(16599) 评论(2) 推荐(4) 编辑