摘要:
一、命令行创建Android应用 android create project -n HelloWorld -t android-22 -p HelloWorld1 -k org.crazyit.helloworld -a HelloWorld 在上面的命令中,-n选项制定创建项目的名称;-t选项指 阅读全文
摘要:
1、服务端public class UdpMulticastServer { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated metho... 阅读全文
摘要:
1、服务端public class UdpBroadcastServer { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated metho... 阅读全文
摘要:
public class UdpServerTest { /** * @param args * @throws SocketException */ public static void main(String[] args) throws SocketExce... 阅读全文
摘要:
1、如果遇到相等的值不进行交换,那这种排序方式是稳定的排序方式。 2、原理:比较两个相邻的元素,将值大的元素交换到右边。 3、思路:依次比较相邻的两个数,将比较小的数放在前面,比较大的数放在后面。 (1)第一次比较:首先比较第1个数和第2个数,将小数放在前面,大数放在后面。 (2)比较第2和第3个数 阅读全文
摘要:
1、穷举算法( primeList = new ArrayList(); int count = 0; // Count the number of prime numbers int number = 2; // A number to be tested for pr... 阅读全文
摘要:
1、穷举算法 时间复杂度(O(n))// 从小到大public static int gcd(int m, int n) { int gcd = 1; for (int i = 2; i = 1; i--) { if (m % i == 0 && ... 阅读全文
摘要:
1、递归方法 时间复杂度(O(2n))public static long fibonacci(long index) { if (index == 0) { return 0; } else if (index == 1) { ... 阅读全文
摘要:
两种方法:一个是使用btye数组(GB2312仅包含常用字,所以会存在失败的情况,推荐使用jar包),一个是引入jar包进行操作。 1、 2、 阅读全文
摘要:
1、GenericMatrix类public abstract class GenericMatrix { /** * Abstract method for adding two elements of the matrices * @param o1 * @param o2 * @ret... 阅读全文