# @link http://www.cnblogs.com/zuoyuan/p/3759682.htmlclass Solution(object): def findMedianSortedArrays(self, nums1, nums2): """ :typ...
分类:
编程语言 时间:
2015-11-08 14:24:30
阅读次数:
213
Write a method to decide if two strings are anagrams or not解法:1 排序比较 (本次解法)2 判断每个字符出现的个数(直接)import java.util.Arrays;public class Anagrams { public ...
分类:
其他好文 时间:
2015-11-06 22:15:00
阅读次数:
183
构造函数 public String(char value[]) 源码public String(char value[]) { int size = value.length; this.offset = 0; this.count = size; this.value = Arrays....
分类:
其他好文 时间:
2015-11-06 12:38:40
阅读次数:
236
题目链接:https://leetcode.com/problems/median-of-two-sorted-arrays/
题目:There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall ru...
分类:
其他好文 时间:
2015-11-06 09:46:52
阅读次数:
234
顶点数据,也称为顶点属性,指每一个顶点数据。指能被用来描述每个顶点的数据,或能被所有顶点使用的常量值。例如你想绘制一个具有颜色的立方体三角形。你指定一个恒定的值用于三角形的所有三个顶点颜色。但三角形的三个顶点位置是不同的,你需要指定一个顶点矩阵存储三个位置值。指定顶点属性数据 顶点属性数据可以...
分类:
其他好文 时间:
2015-11-06 06:45:02
阅读次数:
425
有一个这样的模型伪代码:Arrays array= [a,5,c,1,e,f] 里面有几个对象,假如要把里面的数字删除,如何编码我开始的想法是这样的for (Item item:array) { if (item 是数字) { array.remove(item); }}问题来了,这样写了...
分类:
编程语言 时间:
2015-11-05 23:48:51
阅读次数:
210
publicinterfaceComparator<T>强行对某个对象collection进行整体排序的比较函数。可以将Comparator传递给sort方法(如Collections.sort或Arrays.sort),从而允许在排序顺序上实现精确控制。还可以使用
Comparator来控制某些数据结构(如有序set或有序映射)的顺序,或者..
分类:
编程语言 时间:
2015-11-05 09:09:33
阅读次数:
215
Sum类的题目一般这样:input: nums[], targetoutput: satisfied arrays/ lists/ number拿到题目,首先分析:1. 是几个数的sum2. sum是要求等于target还是小于还是大于还是closest3. 返回的是原数组下标还是其他对于这类题目,...
分类:
其他好文 时间:
2015-11-05 06:10:51
阅读次数:
207
题目链接:https://leetcode.com/problems/median-of-two-sorted-arrays/题目:There are two sorted arraysnums1andnums2of size m and n respectively. Find the media...
分类:
其他好文 时间:
2015-11-04 20:59:15
阅读次数:
185
1.阅读并运行示例PassArray.java,观察并分析程序输出的结果,小结,然后与下页幻灯片所讲的内容进行对照。源代码:// PassArray.java// Passing arrays and individual array elements to methodspublic class ...
分类:
编程语言 时间:
2015-11-02 23:02:10
阅读次数:
352