linux初学

摘要: http://tieba.baidu.com/p/3000822153 阅读全文
posted @ 2015-10-17 00:48 TGomving 阅读(101) 评论(0) 推荐(0) 编辑

LRU(Least Recently Used)置换算法

摘要: 利用一个特殊的站保存当前使用的各个页面的页面号,每当进程访问某页面时,便将该页面的页面号从占中移出,将它压入栈顶。因此,栈顶始终是最新被访问页面的编号,而栈底则是最近最久未使用页面的页面号。 1 package test1; 2 3 import java.util.Stack; 4 5 pub... 阅读全文
posted @ 2015-09-27 22:24 TGomving 阅读(746) 评论(0) 推荐(0) 编辑

求最小正方形的面积

摘要: 1 package test1; 2 3 import java.util.Scanner; 4 import java.util.TreeMap; 5 6 public class baidu1 { 7 8 /* 9 * 利用实现Comparable接口对每个节点按照 x... 阅读全文
posted @ 2015-09-17 22:19 TGomving 阅读(321) 评论(0) 推荐(0) 编辑

null

摘要: 1 package test; 2 3 import java.util.Collection; 4 import java.util.Iterator; 5 import java.util.TreeMap; 6 7 8 public class meituan { 9 10 pu... 阅读全文
posted @ 2015-09-12 13:07 TGomving 阅读(132) 评论(0) 推荐(0) 编辑

去哪儿第三题01

摘要: 练手,仿着写的 1 package test; 2 3 import java.util.LinkedList; 4 5 public class Qunaer031 { 6 7 public int nThreads; //线程池中的线程数 8 public PoolThre... 阅读全文
posted @ 2015-09-11 08:42 TGomving 阅读(119) 评论(0) 推荐(0) 编辑

去哪网第一题

摘要: 1 package test; 2 3 public class Qunaer01 { 4 5 6 public static void substitute(String template,String []args){ 7 8 Strin... 阅读全文
posted @ 2015-09-10 22:46 TGomving 阅读(121) 评论(0) 推荐(0) 编辑

去哪儿第二题

摘要: 有待完善,感觉效率不快 1 package test; 2 3 import java.io.File; 4 import java.io.FileNotFoundException; 5 import java.util.Scanner; 6 7 public class Qunaer { 8... 阅读全文
posted @ 2015-09-10 20:30 TGomving 阅读(98) 评论(0) 推荐(0) 编辑

TreeMap的使用

摘要: TreeMap(树映射)不同于TreeSet,TreeSet(树集)用于对数据进行排序,而TreeMap的节点存储"关键字/值"对,保证节点按照关键字升序排列 1 package test; 2 3 import java.util.Collection; 4 import java.util.I... 阅读全文
posted @ 2015-09-09 09:28 TGomving 阅读(247) 评论(0) 推荐(0) 编辑

位运算符与逻辑运算符在操作逻辑型数据时的区别

摘要: 位运算符在操作逻辑型数据时,与逻辑运算符 && , || , ! 不同的是: 运算符要计算完 a , b之后再给出运算的结果,比较代码如下:1 public class test1 {2 3 public static void main(String[] args) {4 ... 阅读全文
posted @ 2015-09-08 15:07 TGomving 阅读(439) 评论(0) 推荐(0) 编辑

抽象类和接口的区别,使用场景

摘要: shared from http://yinny.iteye.com/blog/11524301 接口是核心,其定义了要做的事情,包含了许多的方法,但没有定义这些方法应该如何做。2 如果许多类实现了某个接口,那么每个都要用代码实现那些方法3 如果某一些类的实现有共通之处,则可以抽象出来一个抽象类,让... 阅读全文
posted @ 2015-08-31 14:52 TGomving 阅读(401) 评论(1) 推荐(1) 编辑