温故知新,基础复习(快速排序及优化)使用了三值取中和插排优化#include
#define InsertSortNumber 10
void InsertSort(int Arra[],unsigned int LowIndex,unsigned int HighIndex)
{
printf("low=%d,high=%d\n",LowIndex,HighIndex);
for (un...
分类:
编程语言 时间:
2015-07-22 00:06:27
阅读次数:
183
温故知新,基础复习(二叉堆排序)最小堆(最终数组的数据是降序),最大堆(最终数组的数据是升序)下例是最小堆#include
#include
void Swap(int Arra[],unsigned int LeftIndex,unsigned int RightIndex)
{
int TeampValue = Arra[LeftIndex];
Arra[LeftIndex]=Arr...
分类:
编程语言 时间:
2015-07-22 00:04:42
阅读次数:
167
一、sizeof sizeof(...)是运算符,在头文件中typedef为unsigned int,其值在编译时即计算好了,参数可以是数组、指针、类型、对象、函数等。它的功能是:获得保证能容纳实现所建立的最大对象的字节大小。由于在编译时计算,因此sizeof不能用来返回动态分配的内存空间的大小。实...
分类:
其他好文 时间:
2015-07-21 21:54:08
阅读次数:
104
#include static union{ char c[4];unsigned long mylong;} endian_test = { {'l','?','?','b'} };#define ENDIANNESS ( (char) endian_test.mylong )int main(....
分类:
系统相关 时间:
2015-07-21 10:21:49
阅读次数:
142
(1)分配设备编号,注册设备与注销设备的函数均在fs.h中声明,如下:extern int register_chrdev_region(dev_t,unsigned int,const char*);表示静态的申请和注册设备号extern int alloc_chrdev_region(dev_t...
分类:
其他好文 时间:
2015-07-21 01:03:55
阅读次数:
187
UNIONUNION ALL//Table AttributeCreate table student( id int unsigned not null auto_increment, name varchar(20) not null, primary key(id))ENGINE=I...
分类:
其他好文 时间:
2015-07-20 19:25:37
阅读次数:
125
#include "stdafx.h"#include #include //GBK编码转换到UTF8编码int GBKToUTF8(unsigned char * lpGBKStr,unsigned char * lpUTF8Str,int nUTF8StrLen){wchar_t * lpUni...
#includeint main(void){unsigned n;while(scanf("%d", &n) != EOF){printf("%d\n\n", (1+n)*n/2);}return 0;}n+1可能出现溢出情况,所以需要将n的数据类型改为unsigned
分类:
其他好文 时间:
2015-07-20 12:48:01
阅读次数:
107
Write a function that takes an unsigned integer and returns the number of ’1' bits it hasFor example, the 32-bit integer ’11' has binary representatio...
分类:
其他好文 时间:
2015-07-20 10:29:37
阅读次数:
104