SFLA=SCE+PSO SCE: shuffled complex evolution algorithm(Duan 1992) = CRS(controlled radom search Price 1978)+Competive evolution(Holland 1975)+shufflin ...
分类:
编程语言 时间:
2017-09-19 20:22:48
阅读次数:
335
一、多线程实现方式 (1)继承Thread类,覆盖run方法 (2)实现Runnable接口,覆盖run方法,将对象传人Thread对象中 实现Runnable接口比继承Thread类所具有的优势: 1)适合多个相同的程序代码的线程去处理同一个资源 2)可以避免java中的单继承的限制 3)增加程序 ...
分类:
编程语言 时间:
2017-09-18 15:08:10
阅读次数:
218
原题链接在这里:https://leetcode.com/problems/maximum-average-subarray-i/description/ 题目: Given an array consisting of n integers, find the contiguous subarra ...
分类:
其他好文 时间:
2017-09-18 14:48:15
阅读次数:
148
Given a binary tree, write a function to get the maximum width of the given tree. The width of a tree is the maximum width among all levels. The binar ...
分类:
其他好文 时间:
2017-09-18 01:18:26
阅读次数:
240
#week2# #from leetcode# Description Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For examp ...
分类:
其他好文 时间:
2017-09-18 00:18:48
阅读次数:
259
题目链接https://leetcode.com/submissions/detail/119156148/ 题目大意:返回一个二叉树的高度。 法一:深搜,左右子树直接递归(耗时1ms),代码如下: 1 private static int maxDepth(TreeNode root) { 2 i ...
分类:
其他好文 时间:
2017-09-17 22:06:10
阅读次数:
140
Given an array consisting of n integers, find the contiguous subarray of given length k that has the maximum average value. And you need to output the ...
分类:
其他好文 时间:
2017-09-17 16:27:05
阅读次数:
116
今天,我给大家分享一下我在学习 RMQ 问题过程中对该问题的理解。 RMQ (Range Minimum/Maximum Query ):中文名为“区间最值查询”。RMQ 问题指的是给定一段区间,针对给定区间进行若干次查询,每次给出不同的待查询子区间范围,要求返回子区间内的最大值或者最小值。 一般此 ...
分类:
其他好文 时间:
2017-09-17 01:27:59
阅读次数:
170
1481:Maximum sum 1481:Maximum sum 总时间限制: 1000ms 内存限制: 65536kB描述Given a set of n integers: A={a1, a2,..., an}, we define a function d(A) as below: t1 t ...
分类:
其他好文 时间:
2017-09-16 23:10:45
阅读次数:
155