Fork me on GitHub
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 37 下一页
摘要: B树 即二叉搜索树: 1.所有非叶子结点至多拥有两个儿子(Left和Right); 2.所有结点存储一个关键字; 3.非叶子结点的左指针指向小于其关键字的子树,右指针指向大于其关键字的子树; 如: B树的搜索,从根结点开始,如果查询的关键字与结点的关键字相等,那么就命中; 否则,如果查询关键字比结点 阅读全文
posted @ 2017-08-11 11:08 hellowOOOrld 阅读(2331) 评论(1) 推荐(0) 编辑
摘要: Find the contiguous subarray within an array (containing at least one number) which has the largest product. For example, given the array [2,3,-2,4],t 阅读全文
posted @ 2017-08-08 18:05 hellowOOOrld 阅读(114) 评论(0) 推荐(0) 编辑
摘要: Given a 2D binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area. For example, given the following ma 阅读全文
posted @ 2017-08-08 15:04 hellowOOOrld 阅读(147) 评论(0) 推荐(0) 编辑
摘要: Print a binary tree in an m*n 2D string array following these rules: Example 1: Example 2: Example 3: Note: The height of binary tree is in the range 阅读全文
posted @ 2017-08-06 11:24 hellowOOOrld 阅读(235) 评论(0) 推荐(0) 编辑
摘要: Given an integer array with no duplicates. A maximum tree building on this array is defined as follow: Construct the maximum tree by the given array a 阅读全文
posted @ 2017-08-06 11:14 hellowOOOrld 阅读(251) 评论(0) 推荐(0) 编辑
摘要: Given a Binary Search Tree and a target number, return true if there exist two elements in the BST such that their sum is equal to the given target. E 阅读全文
posted @ 2017-08-06 11:00 hellowOOOrld 阅读(303) 评论(0) 推荐(0) 编辑
摘要: 某餐馆有n张桌子,每张桌子有一个参数:a 可容纳的最大人数; 有m批客人,每批客人有两个参数:b人数,c预计消费金额。 在不允许拼桌的情况下,请实现一个算法选择其中一部分客人,使得总预计消费金额最大 示例1 输入 3 5 2 4 2 1 3 3 5 3 7 5 9 1 10 输出 20 示例1 输入 阅读全文
posted @ 2017-08-04 17:47 hellowOOOrld 阅读(406) 评论(0) 推荐(0) 编辑
摘要: 转载自:http://www.cppblog.com/darren/archive/2009/06/09/87224.html priority_queue 调用 STL里面的 make_heap(), pop_heap(), push_heap() 算法实现,也算是堆的另外一种形式。 先写一个用 阅读全文
posted @ 2017-08-03 22:46 hellowOOOrld 阅读(240) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return all duplicate subtrees. For each kind of duplicate subtrees, you only need to return the root node of any oneof them. Two 阅读全文
posted @ 2017-08-01 16:01 hellowOOOrld 阅读(615) 评论(0) 推荐(0) 编辑
摘要: Imagine you have a special keyboard with the following keys: Key 1: (A): Prints one 'A' on screen. Key 2: (Ctrl-A): Select the whole screen. Key 3: (C 阅读全文
posted @ 2017-07-31 18:47 hellowOOOrld 阅读(932) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 37 下一页