2015年2月6日

Java异步调用Future对象

摘要: Future类存在于JDK的concurrent包中,主要用途是接收Java的异步线程计算返回的结果。个人理解的使用场景大概如下:有两个任务A和B,A任务中仅仅需要使用B任务计算成果,有两种方法实现:A和B在同一个线程中顺序执行。即先执行B,得到返回结果之后再执行A。开两个线程,A和B并行执行。当A... 阅读全文

posted @ 2015-02-06 15:30 Allen Blue 阅读(7156) 评论(0) 推荐(0) 编辑

2014年5月5日

Java宝典(一)

摘要: -switch语句能作用在byte上,能否作用在long上,能否作用在String上?-在switch(expr1)中,expr1只能是一个整数表达式或者枚举常量,整数表达式可以是int基本类型或Integer包装类型,由于byte,short,char都可以隐式转换为int,所以这些类型以及这些类... 阅读全文

posted @ 2014-05-05 16:52 Allen Blue 阅读(490) 评论(0) 推荐(0) 编辑

Java宝典(二)

摘要: --String s = "a" + "b" + "c" + "d"; 一共创建了多少个对象?--对于如下代码:String s1 = "a";String s2 = s1 + "b";String s3 = "a" + "b";System.out.println(s2 == "ab"); // ... 阅读全文

posted @ 2014-05-05 16:52 Allen Blue 阅读(277) 评论(0) 推荐(0) 编辑

2014年5月4日

【LeetCode练习题】Remove Duplicates from Sorted List II

摘要: Remove Duplicates from Sorted List IIGiven a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the ... 阅读全文

posted @ 2014-05-04 13:51 Allen Blue 阅读(156) 评论(0) 推荐(0) 编辑

2014年4月24日

【LeetCode练习题】Recover Binary Search Tree

摘要: Recover Binary Search TreeTwo elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.互换二叉搜索树中两个... 阅读全文

posted @ 2014-04-24 15:41 Allen Blue 阅读(514) 评论(0) 推荐(0) 编辑

2014年4月21日

搜索引擎--------倒排表数据结构、通配符查询、拼写纠正详解

摘要: 目录:Dictionary Data Structure 词典数据结构Wild-Card Query 通配符查询Spelling Correction 拼写纠正搜索引擎里的dictionary data通常存储着这些信息:索引词(term vocabulary)。文档频率(document freq... 阅读全文

posted @ 2014-04-21 15:19 Allen Blue 阅读(3392) 评论(1) 推荐(4) 编辑

2014年4月19日

Java宝典(四)------Java中也存在内存泄露。

摘要: --Java中会存在内存泄露吗?--如果你想当然的以为Java里有了垃圾回收机制就不会存在内存泄露,那你就错了。Java里也会存在内存泄露!我们慢慢来分析。所谓内存泄露就是指一个不再被程序使用的对象一直占据在内存中。Java中有内存回收机制,他可以保证一对象不再被引用的时候,即对象变成了孤儿的时候,... 阅读全文

posted @ 2014-04-19 15:23 Allen Blue 阅读(1360) 评论(3) 推荐(0) 编辑

Java宝典(三)

摘要: --说说ArrayList,Vector,LinkedList的存储性能和特性。--ArrayList和Vector都是使用数组方式存储数据,此数组元素数大于实际存储的数据以便增加和插入元素,他们都允许直接按序号索引元素,但是插入元素要涉及数组元素移动等内存操作,所以索引数据快而插入数据慢,Vect... 阅读全文

posted @ 2014-04-19 14:51 Allen Blue 阅读(176) 评论(0) 推荐(0) 编辑

2014年4月16日

【LeetCode练习题】Valid Palindrome

摘要: Valid PalindromeGiven a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a pla... 阅读全文

posted @ 2014-04-16 21:12 Allen Blue 阅读(196) 评论(0) 推荐(0) 编辑

2014年4月15日

【Python脚本】Eclipse IDE扩展PyDev插件安装

摘要: 作为一名Python的初学者,其实不用太在意IDE了,我觉得开始的时候用用自带的 IDLE 也挺好的。还有 DreamPie 也挺好的。都是一些轻量级的IDE。因为我正好安装有Eclipse,平时会写一些Java的小东西,所以不如安装一个PyDev插件把Eclipse扩展成一个Python的IDE,... 阅读全文

posted @ 2014-04-15 23:38 Allen Blue 阅读(326) 评论(0) 推荐(0) 编辑

导航