但有时候Person类是别人的类,无法修改,那怎么办呢? 在这种情况下,就可以定义一个新类,如:PersonComparer继承IComparer<Person> Array 类还提供了Sort()多个重载方法,它需要将一个委托作为参数,这个参数可以传递给方法,从而比较2个对象,而不需要依赖ICom ...
分类:
编程语言 时间:
2017-03-06 01:30:25
阅读次数:
212
__get() __set() __isset() __unset __call __callstatic __call是调用不可见(不存在或者没权限)的方法时,自动调用。 $lisi->say(1,2,3) 对象中并不存在say 方法 __call("say",array(1,2,3))运行 __ ...
分类:
Web程序 时间:
2017-03-06 01:29:41
阅读次数:
193
#pragma mark -获取一段字符串中的中文字 + (NSArray *)getAStringOfChineseWord:(NSString *)string { if (string == nil || [string isEqual:@""]) { return nil; } NSMuta ...
分类:
移动开发 时间:
2017-03-05 22:02:31
阅读次数:
619
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-03-05 20:35:29
阅读次数:
159
Excel VBA数组入门教程 1. 前言:不要把VBA数组想的太神秘,它其实就是一组数字而已。 2. 数组的维数: Sub 数组示例() Dim x As Long, y As Long Dim arr(1 To 10, 1 To 3) '创建一个可以容下10行3列的数组空间 For x = 1 ... ...
分类:
编程语言 时间:
2017-03-05 15:49:38
阅读次数:
209
本周学习分治法,故特意挑选了相关习题巩固一下,并回顾一下分治法的思路 题目:Kth Largest Element in an Array Find the kth largest element in an unsorted array. Note that it is the kth large ...
分类:
其他好文 时间:
2017-03-05 14:20:43
阅读次数:
186
package com.baidu.test;import java.util.ArrayList;import java.util.LinkedHashSet;import java.util.List;import org.hibernate.Query;import org.hibernate ...
分类:
Web程序 时间:
2017-03-05 14:15:09
阅读次数:
545
链表的实现一个是node,一个是List。node是链表每个基本组成部分,List操作node。我的思路大概是这样。 node部分代码: List实现一系列对链表的操作: 测试代码: 这个就是一个简单的实现,对于其中的一些算法的实现没有做比较深的研究。有时间去研究一下java实现List的源码。 ...
分类:
编程语言 时间:
2017-03-05 11:30:43
阅读次数:
218
题目内容:Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would ha ...
分类:
其他好文 时间:
2017-03-04 22:15:44
阅读次数:
199
Given an array of integers, every element appears twice except for one. Find that single one. 找出一个数组中唯一一个只出现了一次的数,其余的都出现了两次 ...
分类:
其他好文 时间:
2017-03-04 21:58:29
阅读次数:
134