在项目中对List进行操作时报错java.lang.UnsupportedOperationException,后来发现操作的List是由数组转换而成的,通过看源码发现问题,并写测试程序如下。 代码块: 执行结果: 发生问题的原因如下: 调用Arrays.asList()生产的List的add、re ...
分类:
编程语言 时间:
2018-05-27 14:42:15
阅读次数:
202
/** * 桶排序 */ @Test public void bucketSort(){ int[] array = {5,6,7,8,9,1,2,3,5,6,7,8,9}; buckerSort(array); System.out.println(Arrays.toString(array)); ...
分类:
编程语言 时间:
2018-05-27 13:47:01
阅读次数:
193
public class MathDemo { public static void main(String[] args) { double x=12.2; //取绝对值 System.out.println(Math.abs(-99)); //向上取整 System.out.println(Ma... ...
分类:
编程语言 时间:
2018-05-26 20:23:23
阅读次数:
200
这个题方法相当多,肉眼可见的有三种 第一种,用set 第二种,用map 第三种,对俩数组排序,扫描一遍即可。 ...
分类:
其他好文 时间:
2018-05-26 16:39:27
阅读次数:
112
这里给出两种方法 方法一:用无序关联容器map,用map可以进行很多操作,但是这个题里面用map看起来稍微麻烦一点点。 方法二:用set,这种关联容器可进行的操作和运算较少,但是用在这里恰到好处 ...
分类:
其他好文 时间:
2018-05-26 15:57:45
阅读次数:
147
You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. Find all the next greater numbers for nums1' ...
分类:
其他好文 时间:
2018-05-26 10:48:42
阅读次数:
153
@Configuration public class DataSourceConfig { @Bean public ServletRegistrationBean statViewServlet(){ ServletRegistrationBean bean = new ServletRegis... ...
分类:
编程语言 时间:
2018-05-26 10:41:18
阅读次数:
181
There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity sh ...
分类:
其他好文 时间:
2018-05-25 17:52:26
阅读次数:
109
中文原文:http://www.runoob.com/python/python-2x-3x.html Unicode Python 2 有 ASCII str() 类型,unicode() 是单独的,不是 byte 类型。 现在, 在 Python 3,我们最终有了 Unicode (utf-8) ...
分类:
编程语言 时间:
2018-05-25 11:05:35
阅读次数:
164
Given a paragraph and a list of banned words, return the most frequent word that is not in the list of banned words. It is guaranteed there is at leas ...
分类:
其他好文 时间:
2018-05-23 17:01:36
阅读次数:
187