- 博客(18)
- 资源 (1)
- 收藏
- 关注
原创 搜狗的在线测评
做了两次,有木有搞错!!!,汗!!!本着分享的精神,哥决定把code blog一下下#include #include #include #include #define uint8_t unsigned char #define uint32_t
2011-09-17 14:47:07 1123
原创 单例
<br />1.要点在于: 私有的构造函数 静态成员<br /> <br />//.h#pragma onceclass single{public: static single* getInstance(); ~single(void);private: single(void); static single *sinstance;};//,cpp#include "single.h"#include <iostream>using nam
2010-08-01 14:49:00 240
原创 求非完全二叉树第m层第k个节点
昨天下午朋友发给偶一道题,百度实习的笔试,当时由于各种原因综合作用,竟然TMD的木有写出来!!!心里灰常灰常的不爽!!! 相当之不爽,昨晚就用非常暴力的方法写了下!今天觉得昨晚写的实在是太暴力了,就再小改了下,不过感觉还是很暴力,哈哈 主要就是 按层次遍历,记录层数 #include #include #define M 100typedef str
2010-05-31 10:26:00 1879 1
原创 C文件读写
#include #define SIZE 50int main(){ FILE *fps=NULL; fps=fopen("tests.txt","r"); FILE *fpd=NULL; fpd=fopen("testd.txt","wt+"); fseek(fpd,0,SEEK_END); char buffer[SIZE]; while (fp
2010-02-26 14:56:00 482 1
原创 由XML创建Dom Tree及保存
import java.io.ByteArrayOutputStream;import java.io.File;import java.io.FileWriter;import java.io.IOException;import javax.xml.transform.OutputKeys;import javax.xml.transform.Transformer;i
2010-02-26 11:28:00 998
原创 由字符串建立二叉树
/* 由字符串建立二叉树*/#include #include #include #include using namespace std;typedef struct Tree_Node{ char value; struct Tree_Node *lchild; struct Tree_Node
2008-10-28 17:18:00 3177
原创 冒泡排序
冒泡排序,即通过相邻元素的比较,在一趟排序过程中将最大(小)的元素到正确的位置,如将大的下沉,或者小的上浮;void Bubble_Sort(int* A, int len){ int exchange,temp; for(int i=len;i>0;i--) { exchange=0; for
2008-10-11 23:43:00 316
原创 "iloveyou“ 霍夫曼编码
以前做的数据结构上机实验 #include "stdio.h"#include "stdlib.h"#include "string.h"typedef struct{ int weight; int parent,lchild,rchild;}HTNode,*HuffmanTree;typedef char**HuffmanCode;void Select (Huff
2008-09-20 21:33:00 886
原创 数组的下标应用
比如int w2[5]={1,2,3,4,5};int b=*(w2+3);printf("%d",b);输出4。 int w[3][5]={{1,2,3,4,5}, {6,7,8,9,10}, {11,12,13,14,15}}; int a= *((w+1)[1]); printf("%d",a); 二维数组w ,w为一个二级
2008-07-30 00:21:00 450
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人