In an array A of 0s and 1s, how many non-empty subarrays have sum S? Example 1: Note: 通用解法就是求连续数组的和有多少个,这种题代码都不会变的 把和存起来,给后面的数字-S看有没有这个和,有的话加起来,然后a[an ...
分类:
其他好文 时间:
2018-10-28 13:43:37
阅读次数:
177
【译】提升树算法的介绍(Introduction to Boosted Trees) 1. 有监督学习的要素 XGBoost 适用于 有监督学习 问题。在此类问题中,我们使用多特征的训练数据集 $x_i$ 去预测一个目标变量 $y_i$ 。在专门学习树模型前,我们先回顾一下有监督学习的基本要素。 E ...
分类:
编程语言 时间:
2018-10-27 21:14:56
阅读次数:
188
function bc = binary_conversion(a) %这是灰度值二值化转换函数,阈值为平均值j=imread(a); %读取灰度图像 j=double(j); %将图像转换为小数浮点型(double)[m,n]=size(j); %获取图像的长宽(m,n)s=sum(sum(j)) ...
分类:
其他好文 时间:
2018-10-27 10:24:59
阅读次数:
358
Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively. Below is one possible representati ...
分类:
其他好文 时间:
2018-10-27 00:22:06
阅读次数:
121
MySQL 日志初探 [TOC] 零、概述 MySQL 的日志分为 Error Log(错误日志),General Query Log(通用查询日志)、Slow Query Log(慢查询日志)、Binary Log(BinLog),各种日志各有各的用处和配置方式,接下来进行简单的介绍。 一、Err ...
分类:
数据库 时间:
2018-10-26 14:29:53
阅读次数:
312
因项目需要,需要用一个将二值图像保存在二维数组中的算法,在网上找了很久都没找到,只能自己动手写了。 ...
分类:
编程语言 时间:
2018-10-26 13:12:03
阅读次数:
159
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 ...
分类:
其他好文 时间:
2018-10-26 10:45:37
阅读次数:
243
【题目】 Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farth ...
分类:
其他好文 时间:
2018-10-26 10:36:02
阅读次数:
140
前天的面试题,其实认真去做,去思考的话,也并不难。 感觉面试的话,笔试还是比较难的,因为没办法去一点点的去测试。 另外,感觉面试还是要先去准备一下的,如果像我这样基础比较差,就直接就去面试的话,手写面试题,的确有点难度。 这些题目是我早上花了1小时左右才写完的。如果你去面试也遇到了这些题目的话,希望 ...
分类:
其他好文 时间:
2018-10-25 14:02:06
阅读次数:
115
Return any binary tree that matches the given preorder and postorder traversals. Values in the traversals pre and post are distinct positive integers. ...
分类:
其他好文 时间:
2018-10-25 11:16:41
阅读次数:
153