上一页 1 ··· 38 39 40 41 42 43 44 45 46 ··· 53 下一页

插入排序

摘要: 插入排序 是一种对原有序列排序的方法,逐步使原序列的有序序列增长折半插入排序 是在寻找 当前元素的位置时采取了折半查找的方法#include"stdio.h" #include"stdlib.h" typedef struct SqList{ int * elem; int length; int MaxSize; }SqList; void CreatList(SqList &L) { L.elem=(int *)malloc(100 * sizeof(int)); if(!L.elem) exit(0); else { L.length = 阅读全文
posted @ 2012-01-03 11:31 java课程设计例子 阅读(232) 评论(0) 推荐(0) 编辑

JAVA遇到大批数据处理时会出现Java heap space的报错的解决方案

摘要: Java heap space一直是困扰我们的一个问题。像Matlab就可以一次性读取5000*5000的数据到一个矩阵matrix中。然而Java确不行。我遇到实验室处理一个“合并5000左右txt文档到一个txt文件中”的问题,相同的算法用Matlab就不会出现内存不足的问题,而JAVA则会报出:java.lang.OutOfMemoryError: Java heap space。从这里可以判断的说Matlab是为处理大型数据而设计(It is conceived for),所以其执行代码时对内存启动了自动的分配与管理。因为我的5000左右txt文档大约有180M,显而易见,同时读到内存 阅读全文
posted @ 2012-01-02 23:55 java课程设计例子 阅读(406) 评论(0) 推荐(0) 编辑

JAVA列出文件夹中的所有文件

摘要: It shows that we can list all the files in a specified folder, if it exists.package com.han; import java.io.File; /** * It shows that we can list all the files in a specified folder, if it exists. * @author han * */ public class ListFiles { public static void main(String[] args) { // TODO ... 阅读全文
posted @ 2012-01-02 18:42 java课程设计例子 阅读(220) 评论(0) 推荐(0) 编辑

JAVA在命令行界面中进行输入数据的方法

摘要: How to input your personal data from the default command interface.It used the System.in.read, contrast to the System.out.print.package com.han; import java.io.*; /** * How to input your personal data from the default command interface. * <p> * It used the System.in.read, contrast to the Syste 阅读全文
posted @ 2012-01-02 18:38 java课程设计例子 阅读(250) 评论(0) 推荐(0) 编辑

JAVA中File的相关操作

摘要: Creation of a file if it does not exist; Deletion of a file if it already exists.package com.han; import java.io.File; /** * Creation of a file if it does not exist; * Deletion of a file if it already exists. * @author han * */ public class FileTest { public static void main(String[] args) ... 阅读全文
posted @ 2012-01-02 18:30 java课程设计例子 阅读(232) 评论(0) 推荐(0) 编辑

JAVA中Icon接口的应用(以JLabel为例)

摘要: This example shows the drawing of an icon using the Icon interface for the JLable component.package com.han; import java.awt.*; import javax.swing.*; /** * This example shows the drawing of an icon using the Icon interface * for the JLable component. * @author han * */ public class DrawIcon i... 阅读全文
posted @ 2012-01-02 18:07 java课程设计例子 阅读(305) 评论(0) 推荐(0) 编辑

JAVA中JDialog的举例

摘要: This program demonstrates the creation of a JDialog from a super-window. The created dialog is on the mode "Modal".package com.han; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.*; /** * This program demonstrates the creation 阅读全文
posted @ 2012-01-02 17:44 java课程设计例子 阅读(714) 评论(0) 推荐(0) 编辑

JAVA this关键字用在构造方法中

摘要: this 关键字用在构造方法中。package com.han; /** * this 关键字用在构造方法中。 * @author han * */ public class ThisUse { public ThisUse() { this("this调用无参构造方法之前先调用有参构造方法"); //it is equivalent to : new ThisUse("this调用无参构造方法之前先调用有参构造方法"); System.out.println("this调用无参构造方法"); } public ThisUse(Str 阅读全文
posted @ 2012-01-02 06:49 java课程设计例子 阅读(184) 评论(0) 推荐(0) 编辑

JAVA中Map集合的使用举例

摘要: 首先创建一个Emp类,再将几个Emp对象添加到Map集合中。 Emp的id作为Map的键,并将id为“005”的对象从集合中删除。package com.han; import java.util.*; /** * 首先创建一个Emp类,再将几个Emp对象添加到Map集合中。 * Emp的id作为Map的键,并将id为“005”的对象从集合中删除。 * @author han * */ public class MapApps { @SuppressWarnings({ "unchecked", "rawtypes" }) public static v 阅读全文
posted @ 2012-01-02 06:40 java课程设计例子 阅读(340) 评论(0) 推荐(0) 编辑

JAVA Set与List集合区别

摘要: 分别向Set集合和List集合中添加"A","a","c","C","a"5个元素, 观察重复的a值能否在List或者Set中成功添加。package com.han; import java.util.*; /** * 分别向Set集合和List集合中添加"A","a","c","C","a"5个元素, * 观察重复的a值能否在List或者Set中成功添加。 * @author han * */ 阅读全文
posted @ 2012-01-02 06:31 java课程设计例子 阅读(155) 评论(0) 推荐(0) 编辑
上一页 1 ··· 38 39 40 41 42 43 44 45 46 ··· 53 下一页