自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(18)
  • 资源 (3)
  • 收藏
  • 关注

原创 Java中byte[]、char[]和String的相互转化

//String to char[]new String().toCharArray();//String to byte[]new String().getBytes();new String().getBytes("GBK"); //char[] to Stringnew String(new char[]{});Arrays.toString(new char[]{});//byte[

2014-04-07 13:44:51 1191

原创 由不同编号生成策略产生的多线程问题及解决

最近复习Java多线程时,看到”生产者消费者问题“—— 这是个多线程并发访问的经典案列,操作系统知识中也讲到过,详细内容就不在此列出了,如果有不明的,可以参考我的另一篇文章”多线程经典案例——生产者/消费者问题的Java实现与详解“。在这个问题中,为了输出更加友好的信息,我按”生产日期+生产总数"对产品进行了编号。实现这一策略的思路是:生产者每生产出一个Product,记录Product总量的

2014-04-05 20:48:07 1839

原创 Java字节流和字符流实例

1.基本概念按数据类型分:Java有字节流和字符流两种:字节流:InputStream/OutputStream字符流:Reader/Writer字节流读取的时候,读到一个字节就返回一个字节;字符流使用了字节流读到一个或多个字节(中文对应的字节是两个,UTF-8码表中是3个)时,先去查指定的编码表,将查到的字符返回。2.常用子类字节流都是以InputStream

2014-04-03 15:47:49 1532 1

原创 Java静态内部类实例

package com.swsx.sort;import java.util.ArrayList;import java.util.Collections;import java.util.Comparator;import java.util.List;public class TestComparator { public static void main(String[]

2014-04-02 14:42:42 1221

原创 使用 Java HashSet 时要注意的一些地方

HashSet类主要是设计用来做高性能集运算的,例如对两个集合求交集、并集、差集等。集合中包含一组不重复出现且无特性顺序的元素。HashSet的一些特性如下:1、HashSet中的值不能重复且没有顺序。2、HashSet的容量会按需自动添加。下面是使用 Java HashSet 时要注意的一些地方:package com.swsx.hashCode;import java.

2014-04-02 13:10:07 2050

原创 多线程经典案例——生产者/消费者问题的Java实现与详解

生产者消费者问题(英语:Producer-consumer problem),也称有限缓冲问题(英语:Bounded-buffer problem),是一个多线程同步问题的经典案例。该问题描述了两个共享固定大小缓冲区的线程——即所谓的“生产者”和“消费者”——在实际运行时会发生的问题。生产者的主要作用是生成一定量的数据放到缓冲区中,然后重复此过程。与此同时,消费者也在缓冲区消耗这些数据。该问题的关

2014-04-01 12:37:38 3328

转载 oracle学习笔记(马士兵)

第一课:客户端        1. Sql Plus(客户端),命令行直接输入:sqlplus,然后按提示输入用户名,密码。        2. 从开始程序运行:sqlplus,是图形版的sqlplus.        3. http://localhost:5560/isqlplus                Toad:管理, PlSql Developer:

2013-12-08 16:11:02 736

原创 数据库核心知识备忘

【数据库三大类语句】: DML:insert,delete,update,select...  (数据操作语句) Data Manipulation Language statements DDL:create,drop,alter...           (数据定义语句)Data Definition Language statements DCL:grant,commit,rol

2013-12-08 16:10:16 765

原创 Java日期处理

package com.tlj.jdbc;import java.sql.*;import java.text.SimpleDateFormat;import java.util.Calendar;import java.util.Date;import java.util.GregorianCalendar;import java.util.TimeZone;/** * 日期处理

2013-12-08 16:08:12 703

原创 多态例子——Java和C++实现

Java用关键字abstract修饰类名来定义一个抽象类,而C++只要在类中定义一个或多个纯虚函数(虚函数后加“ = 0”)就可使该类成为抽象类。Java实现例子:abstract class Pet{//抽象类 protected String name; public abstract void enjoy();//抽象方法 public String ge

2013-06-29 20:47:26 716

转载 UML类图关系(泛化 、继承、实现、依赖、关联、聚合、组合)

UML类图关系(泛化 、继承、实现、依赖、关联、聚合、组合)转载自:http://www.cnblogs.com/olvo/archive/2012/05/03/2481014.html继承、实现、依赖、关联、聚合、组合的联系与区别分别介绍这几种关系:继承指的是一个类(称为子类、子接口)继承另外的一个类(称为父类、父接口)的功能,并可以增加它自己的新功能的能力,

2013-06-19 21:38:27 749

原创 C++类的直接初始化和复制初始化举例

(1)对于一般的内建类型,这两种初始化基本上没有区别。           int a(5);//直接初始化           int a=5;//复制初始化           int a=int (5);//直接初始化 (2)当用于类类型对象时,初始化的复制形式和直接形式有所不同:         直接初始化直接调用与实参匹配的构造函数,复制初始化总是调用复制构造函数。

2013-03-18 20:05:48 1204

原创 统计文件中单词的信息

#include #include #include #include #include #include using namespace std; int main(void){ ifstream finput("string.txt",ifstream::in);vector vmax,vmin;string word;size_

2013-03-04 14:24:32 431

原创 让快速排序真正地"快起来"

1.背景:       快速排序(Quicksort)是对冒泡排序的一种改进。由C. A. R. Hoare在1962年提出。它的基本思想是:通过一趟排序将要排序的数据分割成独立的两部分,其中一部分的所有数据都比另外一部分的所有数据都要小,然后再按此方法对这两部分数据分别进行快速排序,整个排序过程可以递归进行,以此达到整个数据变成有序序列。      同其他排序方法相比,快速排序是

2012-11-11 11:56:16 495

原创 哈希表查找C实现(详细注释)

【定义】:1.哈希函数:在记录的存储位置和它的关键字之间建立一个确定的对应关系ƒ,使每个关键字和结构中的一个唯一的存储位置相对应,称这个对应关系ƒ为哈希函数(Hash Function)(或散列函数)。 2.冲突:对不同的关键字可能得到同一哈希地址,即key1≠key2,而ƒ(key1)=ƒ(key2)  ,这种现象称冲突(collision)。3.哈希表:根据设定的哈希函数H

2012-11-05 13:19:51 3005

原创 求不小于m÷n的最小整数和不大于m÷n的最大整数

#include int Nonsmaller_Min_Int(double m,double n){//不小于m÷n的最小整数 if (m * n > 0) { if (m/n != (int)(m/n)) { return m/n + 1; } } return m/n; //re

2012-10-30 15:50:16 1557

原创 如何在字符数组中存储空白字符

C没有为字符串定义专门的数据类型,而是把它存储在字符数组中,虽然这种方法可以有效地解决字符串存储问题,但当使用scanf函数为字符数组赋值时,含有空白符(空格、制表符、换行符)的字符串却无法完整储存。如:#includeint main(void){char str[256];scanf("%s",str);printf("%s\n",str); return 0;

2012-03-14 19:11:42 8689

原创 C语言链表综合操作

/*----------------------------------预处理命令-----------------------------------------*/#include #include #define LEN sizeof(struct student)#define FORMAT "%ld,%f"#define P_FORMAT "%ld   %5.1f\n

2012-03-10 13:12:48 536

wifi热点创建助手(win7)

用C++、Qt编写的一个小工具,可以帮助win7用户开启wifi热点实现网络共享,让用户轻轻松松用手机上网。

2014-04-08

数据结构与算法全集(C源代码+详细注释)

全集内容结构如下: ├─图 │ ├─关键路径(有向无环图及其应用2) │ │ 1.txt │ │ ALGraph.cpp │ │ ALGraph.h │ │ CriticalPath.cpp │ │ CriticalPath.h │ │ InfoType.cpp │ │ InfoType.h │ │ LinkList.cpp │ │ LinkQueue.cpp │ │ LinkQueue.h │ │ Main.cpp │ │ SqStack.cpp │ │ SqStack.h │ │ Status.h │ │ VertexType.cpp │ │ VertexType.h │ │ │ ├─图的关节点 │ │ 1.txt │ │ ALGraph.cpp │ │ ALGraph.h │ │ FindArticul.cpp │ │ FindArticul.h │ │ InfoType.cpp │ │ InfoType.h │ │ LinkList.cpp │ │ LinkQueue.cpp │ │ LinkQueue.h │ │ main.cpp │ │ Status.h │ │ VertexType.cpp │ │ VertexType.h │ │ │ ├─图的数组表示法 │ │ InfoType.cpp │ │ InfoType.h │ │ Main.cpp │ │ MGraph.cpp │ │ MGraph.h │ │ Status.h │ │ VertexType.cpp │ │ VertexType.h │ │ │ ├─图的遍历 │ │ ALGraph.cpp │ │ ALGraph.h │ │ DEBUG.txt │ │ InfoType.cpp │ │ InfoType.h │ │ LinkList.cpp │ │ LinkQueue.cpp │ │ LinkQueue.h │ │ Main.cpp │ │ MGraph.cpp │ │ MGraph.h │ │ MTraverse.cpp │ │ MTraverse.h │ │ Status.h │ │ t1.txt │ │ t2.txt │ │ VertexType.cpp │ │ VertexType.h │ │ │ ├─图的邻接表存储结构 │ │ ALGraph.cpp │ │ ALGraph.h │ │ InfoType.cpp │ │ InfoType.h │ │ LinkList.cpp │ │ LinkQueue.cpp │ │ LinkQueue.h │ │ Main.cpp │ │ Status.h │ │ t1.txt │ │ t2.txt │ │ VertexType.cpp │ │ VertexType.h │ │ │ ├─最短路径(从某个源点到其余各顶点的的最短路径) │ │ 1.txt │ │ 2.txt │ │ InfoType.cpp │ │ InfoType.h │ │ Main.cpp │ │ MGraph.cpp │ │ MGraph.h │ │ ShortestPath_DIJ.cpp │ │ ShortestPath_DIJ.h │ │ Status.h │ │ VertexType.cpp │ │ VertexType.h │ │ │ └─最短路径(每一对顶点间的最短路径) │ 1.txt │ 2.txt │ InfoType.cpp │ InfoType.h │ Main.cpp │ map.txt │ MGraph.cpp │ MGraph.h │ RailwaySearch.cpp │ ShortestPath_FLOYD.cpp │ ShortestPath_FLOYD.h │ Status.h │ VertexType.cpp │ VertexType.h │ ├─排序 │ ├─冒泡排序 │ │ 1.txt │ │ main.cpp │ │ RedType.cpp │ │ RedType.h │ │ Sq_BubbleSort.cpp │ │ Sq_BubbleSort.h │ │ │ ├─哈希表(哈希查找) │ │ ElemType.cpp │ │ ElemType.h │ │ HashTable.cpp │ │ HashTable.h │ │ main.cpp │ │ Records.txt │ │ │ ├─基数排序 │ │ 1.txt │ │ main.cpp │ │ SLL_RadixSort.cpp │ │ SLL_RadixSort.h │ │ │ ├─归并排序 │ │ 1.txt │ │ main.cpp │ │ RedType.cpp │ │ RedType.h │ │ sq_MergeSort.cpp │ │ sq_MergeSort.h │ │ │ ├─快速排序 │ │ 1.txt │ │ 2.txt │ │ 3.txt │ │ main.cpp │ │ RedType.cpp │ │ RedType.h │ │ Sq_QuitSort.cpp │ │ Sq_QuitSort.h │ │ │ ├─拓扑排序(有向无环图及其应用) │ │ 1.txt │ │ ALGraph.cpp │ │ ALGraph.h │ │ InfoType.cpp │ │ InfoType.h │ │ LinkList.cpp │ │ LinkQueue.cpp │ │ LinkQueue.h │ │ Main.cpp │ │ SqStack.cpp │ │ SqStack.h │ │ Status.h │ │ TopologicalSort.cpp │ │ TopologicalSort.h │ │ VertexType.cpp │ │ VertexType.h │ │ │ ├─插入排序 │ │ 1.txt │ │ main.cpp │ │ RedType.cpp │ │ RedType.h │ │ Sq_InsertSort.cpp │ │ Sq_InsertSort.h │ │ │ ├─插入排序(希尔排序) │ │ main.cpp │ │ RedType.cpp │ │ RedType.h │ │ Sq_InsertSort.cpp │ │ Sq_InsertSort.h │ │ │ ├─插入排序(表插入排序) │ │ 1.txt │ │ main.cpp │ │ RedType.cpp │ │ RedType.h │ │ SL_InsertSort.cpp │ │ SL_InsertSort.h │ │ │ ├─选择排序(堆排序) │ │ 1.txt │ │ 2.txt │ │ 3.txt │ │ main.cpp │ │ RedType.cpp │ │ RedType.h │ │ Sq_HeapSort.cpp │ │ Sq_HeapSort.h │ │ │ ├─选择排序(树形选择排序) │ │ 1.txt │ │ main.cpp │ │ RedType.cpp │ │ RedType.h │ │ Sq_TreeSelectionSort.cpp │ │ Sq_TreeSelectionSort.h │ │ │ └─选择排序(简单选择排序) │ 1.txt │ main.cpp │ RedType.cpp │ RedType.h │ Sq_SelectSort.cpp │ Sq_SelectSort.h │ ├─查找 │ ├─动态查找表(二叉排序树) │ │ 1.txt │ │ BiTree.cpp │ │ BiTree.h │ │ DElemType.cpp │ │ DElemType.h │ │ DSTable.cpp │ │ DSTable.h │ │ LinkQueue.cpp │ │ LinkQueue.h │ │ main.cpp │ │ QElemType.h │ │ Status.h │ │ TElmeType.h │ │ │ ├─平衡二叉树(二叉排序树的平衡旋转生成) │ │ 1.txt │ │ BBSTree.cpp │ │ BBSTree.h │ │ BiTree.cpp │ │ BiTree.h │ │ DElemType.cpp │ │ DElemType.h │ │ DSTable.cpp │ │ DSTable.h │ │ LinkQueue.cpp │ │ LinkQueue.h │ │ main.cpp │ │ QElemType.h │ │ Status.h │ │ TElmeType.h │ │ │ ├─平衡的m路查找树—B_树 │ │ BTree.cpp │ │ BTree.h │ │ main.cpp │ │ Record.h │ │ Status.h │ │ │ ├─键树(Trie树) │ │ 1.txt │ │ main.cpp │ │ Record.h │ │ Status.h │ │ TrieTree.cpp │ │ TrieTree.h │ │ │ ├─键树(双链键树) │ │ 1.txt │ │ DLTree.cpp │ │ DLTree.h │ │ main.cpp │ │ Record.h │ │ Status.h │ │ │ ├─静态查找表(有序表的查找) │ │ 1.txt │ │ main.cpp │ │ SElemType.cpp │ │ SElemType.h │ │ SSTable.cpp │ │ SSTable.h │ │ Status.h │ │ │ ├─静态查找表(静态树表查找) │ │ 1.txt │ │ BiTree.cpp │ │ BiTree.h │ │ LinkQueue.cpp │ │ LinkQueue.h │ │ main.cpp │ │ QElemType.h │ │ SElemType.cpp │ │ SElemType.h │ │ SSTable.cpp │ │ SSTable.h │ │ Status.h │ │ TElmeType.h │ │ │ └─静态查找表(顺序表的查找) │ 1.txt │ main.cpp │ SElemType.cpp │ SElemType.h │ SSTable.cpp │ SSTable.h │ Status.h │ ├─树 │ ├─二叉树的二叉链表存储 │ │ BiTree.cpp │ │ BiTree.h │ │ LinkQueue.cpp │ │ LinkQueue.h │ │ main.cpp │ │ QElemType.h │ │ Status.h │ │ TElmeType.h │ │ │ ├─二叉树的顺序存储结构 │ │ main.cpp │ │ SqBiTree.cpp │ │ SqBiTree.h │ │ Status.h │ │ TELemType_define.cpp │ │ │ ├─哈夫曼树和哈夫曼编码 │ │ HuffmanTree.cpp │ │ HuffmanTree.h │ │ main.cpp │ │ Status.h │ │ │ ├─最小生成树 │ │ 1.txt │ │ InfoType.cpp │ │ InfoType.h │ │ Main.cpp │ │ MGraph.cpp │ │ MGraph.h │ │ MiniSpanTree_Kruskal.cpp │ │ MiniSpanTree_Kruskal.h │ │ MiniSpanTree_PRIM.cpp │ │ MiniSpanTree_PRIM.h │ │ Status.h │ │ VertexType.cpp │ │ VertexType.h │ │ │ ├─树的二叉链表 │ │ CSTree.cpp │ │ CSTree.h │ │ LinkQueue.cpp │ │ LinkQueue.h │ │ main.cpp │ │ QElemType.h │ │ Status.h │ │ TElmeType.h │ │ │ ├─深度优先生成森林(无向图的连通性和生成树) │ │ ALGraph.cpp │ │ ALGraph.h │ │ CSTree.cpp │ │ CSTree.h │ │ DFSForest.cpp │ │ DFSForest.h │ │ InfoType.cpp │ │ InfoType.h │ │ LinkList.cpp │ │ LinkQueue.cpp │ │ LinkQueue.h │ │ Main.cpp │ │ QElemType.h │ │ Status.h │ │ TElmeType.h │ │ VertexType.cpp │ │ VertexType.h │ │ │ └─线索二叉树 │ BiThrTree.cpp │ BiThrTree.h │ main.cpp │ Status.h │ TElmeType.h │ └─表和数组 ├─KMP算法 │ Basic_operation_functions.h │ def_SString.h │ KMP.h │ main.cpp │ Status.h │ ├─n阶对称矩阵的压缩存储 │ Basic_operation_functions.h │ mian.cpp │ Status.h │ struct SyMatrix.h │ ├─三元组稀疏矩阵的压缩存储 │ Basic_operation_functions.h │ B_opera_fun_called_fun.h │ main.cpp │ Status.h │ struct TSMatrix.h │ Universal_main.h │ Universa_ts_b_opera_fun.h │ ├─不设头结点的单链表 │ LinkList.cpp │ LinkList.h │ main.cpp │ Status.h │ ├─串的堆存储结构 │ Basic_operation_functions.h │ HString.h │ Line_List.h │ main.cpp │ Status.h │ ├─串的定长顺序存储结构 │ Basic_operation_functions.h │ def_SString.h │ Main.cpp │ Status.h │ ├─广义表 │ GList.cpp │ GList.h │ main.cpp │ SString.cpp │ SString.h │ Status.h │ ├─数组 │ Basic_operation_functions.h │ main.cpp │ Status.h │ struct array.h │ ├─文本编辑(串和行表操作) │ Basic_operation_functions.h │ HString.h │ Line_List.h │ main.cpp │ Status.h │ ├─栈的顺序存储结构 │ main.cpp │ SqStack.cpp │ SqStack.h │ Status.h │ ├─走迷宫 │ Basic_called_functions.h │ Basic_operation_functions.h │ Main_Maze.cpp │ Status.h │ struct SqStack.h │ └─链队列 Basic_called_functions.cpp Basic_called_functions.h Basic_operation_functions.cpp main.cpp QElemType.h Status.h Struct_LinkQueue.h

2012-11-27

小游戏:暗影迷宫

用C编的控制台小游戏 好不好玩大家试一下就知道了!

2012-10-03

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除