代码改变世界

随笔档案-2012年2月19日

《算法导论》第8章 线性时间排序 (1)计数排序

2012-02-19 15:32 by java线程例子, 164 阅读, 收藏,
摘要: 一种简单的实现是得到数组C,C[i]表示数组A中值为i的元素个数。C = { 2, 0, 2, 3, 0, 1 }就表示两个0,两个2,三个3,一个5。然后将这些数字依次存到数组B中。#include <stdio.h>#include <stdlib.h>void printArray(int[], int);void counting_sort(int A[], int B[], int len, int k){ int* C = calloc(k + 1, sizeof(int)); int j; for (j = 0; j < len; j++) C[A[ 阅读全文

should be mapped with insert="false" update="false"

2012-02-19 12:56 by java线程例子, 238 阅读, 收藏,
摘要: 我 找了好久原来是个低级错误,在copy的时候不小心的缘故<hibernate-mapping package="com.strive.entity"> <class name="Dept" table="Dept"> <id name="deptno" column="deptno" type="integer"> <generator class="assigned"></generator> 阅读全文