11 2012 档案

线性表
摘要:一、顺序表可用一维数组实现1、初步实现思路 假设数据类型为ElemType,存储100个元素的数组ElemType elem[100]; 顺序表还需要什么属性,怎样表示顺序表?将顺序表定义为:顺序表定义1 typedef struct 2 {3 ElemType elem[MAXSIZE];//存储顺序表元素4 int length; //元素数目,也称长度5 }List;1.1初始化ListInit1 Status ListInit ( List &L )//初步实现——初始化2 { 3 L.length= 0 ; 4 return OK ; ... 阅读全文

posted @ 2012-11-24 20:05 whl-hl 阅读(238) 评论(0) 推荐(0)

C语言遍历文件夹内容
摘要:1、函数介绍func.h/* * 文件名称:filename.h * 文件标识:见配置管理计划书 * 摘 要:遍历某文件加下%i_%i_%i_%i_%i.txt格式的文件,存储到数组中* * 当前版本:1.0* 作 者:whl * 完成日期:2012-11-17*/ #include "func.h"#include <string.h>#include <stdio.h>#include <IO.H>//将文件名转换为整形的以便建树void convert(struct FileName_type txtfile[],int lengt 阅读全文

posted @ 2012-11-17 12:20 whl-hl 阅读(414) 评论(0) 推荐(0)

sizeof
摘要:sizeof 阅读全文

posted @ 2012-11-09 22:47 whl-hl 阅读(127) 评论(0) 推荐(0)

test_2012-11-7
摘要:1、建立索引BuildIndex.c#include <stdio.h>#include <stdlib.h>#include <string.h>#include <time.h>#define random(x) (rand()%100)#define NULL 0#define Att_Order 3 //属性个数#define Att_Length 10 //属性长度#define Path_Length 20 //路径长度struct Index{ char attribute[Att_Order][Att_Length]; char 阅读全文

posted @ 2012-11-07 14:44 whl-hl 阅读(141) 评论(0) 推荐(0)

C语言练习
摘要:练习1:1、编写程序,利用输出语句将自己的简单介绍文字输出到文本文件“resume.txt”2、完成一个冒泡排序的算法程序,排序对象为int型,主程序需要考虑输入、输出方式。练习23、实现一个二分查找算法,要求:查找对象:整数(已排好序);排序算法写在独立函数,类似于:int BinarySearch(int data[],int n,int value)data[]是一个排好序的整数数组;n是数组的维数;value是查找的对象;如果找到函数返回命中的数组下标,否则返回-14、实现一个新浪微博MID转换算法 新浪微博的消息ID(MID)有字符型和数字型两种形态,可以互相转换。数字型值是字符型值 阅读全文

posted @ 2012-11-06 21:28 whl-hl 阅读(201) 评论(0) 推荐(0)

导航