哲学家问题是操作系统中资源分配的经典问题 linux平台下的系统api不同于Windows下的实现 要求:一个正确的哲学家程序(不会发生死锁) 一个错误的哲学家程序(会发生死锁) 系统环境:ElementaryOS wrong.c right.c ...
分类:
系统相关 时间:
2017-01-06 16:20:01
阅读次数:
264
/** * 直接插入排序 * @author TMAC-J * 思路:详情见百度百科,解释的很清楚 * 这里没有对向后移动做优化,有兴趣的可以自己做做 * */ public class InsertSort { private int[] array; public InsertSort(int[... ...
分类:
编程语言 时间:
2017-01-06 15:27:33
阅读次数:
243
flex中下拉框的实现 <mx:ComboBox id = “combobox” dataProvider = “{deviceCodeType }” editable = “true”>deviceCodeType = new ArrayCollection();deviceCodeType.ad ...
分类:
其他好文 时间:
2017-01-06 12:53:00
阅读次数:
155
题解: 把ai认为是i的父亲,使其连边,那么题目给出的关系构成了一个基环树森林。 对于在环外、指向环的边(即“树”的部分),使骰子的每一个面都比其父亲大。 观察1、4样例可以发现一个构造方式:对于一个大小为n环,从第一个点开始,逆着父亲边放入1~n;再从第一个点在环上的儿子开始,逆着父亲边以此放入n ...
分类:
其他好文 时间:
2017-01-06 12:21:31
阅读次数:
179
/**
*设置获取获取当前请求的参数
*@accesspublic
*@paramstring|array$name变量名
*@parammixed$default默认值
*@paramstring|array$filter过滤方法
*@returnmixed
*/
publicfunctionparam($name=‘‘,$default=null,$filter=null)
{//设置或者获取当前请求的参数
if(empty($thi..
分类:
Web程序 时间:
2017-01-06 11:23:00
阅读次数:
254
$map['id|username'] = array(intval($keyword),array('like', '%' . $keyword . '%'),'_multi' => true);return Array ( [id|username] => Array ( [0] => 1932 ...
分类:
其他好文 时间:
2017-01-06 11:02:40
阅读次数:
287
<?php $units = array(); for($i=0;$i<1000000;$i++){ $units[] = uniqid(); } $values = array_count_values($units); $duplicates = []; foreach($values as $ ...
分类:
Web程序 时间:
2017-01-06 09:28:16
阅读次数:
242
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. ...
分类:
其他好文 时间:
2017-01-06 08:01:52
阅读次数:
157
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of ...
分类:
其他好文 时间:
2017-01-06 07:55:26
阅读次数:
180
Given a list of words (without duplicates), please write a program that returns all concatenated words in the given list of words. A concatenated word ...
分类:
其他好文 时间:
2017-01-06 01:18:26
阅读次数:
206