07 2012 档案
摘要:栈:#include "stdio.h"#include "stdlib.h"#define MAX_SIZE 100typedef struct stack{ int *base; int top;}Stack;int InitStack(Stack *stack){ stack->base=(int *)malloc(MAX_SIZE*sizeof(int)); if(!stack->base) return -1; stack->top=0; return 1;}int IsEmpty(Stack *stack){ if(0==s
阅读全文
摘要:模式串匹配算法:#include "stdio.h"int Index(char *S,char *T,int pos){ int i,j,slen,tlen; slen=strlen(S); tlen=strlen(T); i=pos; j=0; while(i<slen&&j<tlen) { if(S[i]==T[j]) { i++; j++; } else { i=i-j+1;//如果j=0就相当于将i右移一位 ...
阅读全文
摘要:二分查找using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace Bsearch{ class Program { static void Main(string[] args) { int[] arr={1,2,3,4,5,6,7,8,9,10,11};//二分查找的对象是一个已经有序的顺序表 int r = Bsearch(arr,11); Console.Wr...
阅读全文
摘要:/* Note:Your choice is C IDE */#include "stdio.h"void main(){ int i,j,temp,d,a[10]; printf("请输入数组的元素:\n"); for(i=0; i=1; i--) for(j=0;...
阅读全文
摘要:BinaryTreeusing System;using System.Collections.Generic;using System.Linq;using System.Text;namespace BinaryTree{ public class BinaryTree { private Node _head; private string cStr; public Node Head { get { return _head; } set { _head = value; }...
阅读全文
摘要:我的博客园账号是在大三开的,到现在毕业工作,闲置了一年多,一直没写过什么东西。最近参加公司的培训,发现自己肚里有货是一回事,把那点货说出来是一回事,而把自己知道的说出来让人感觉浅显易懂又是另外一回事。市面上很多书都冠以“深入浅出”,个人感觉这四个字不是随便乱用的,《Head First 设计模式》算是做得很不错的了。当然并不是所有大牛都乐于分享,但那些乐于分享技术经验的人都是值得尊敬的。作为一枚菜鸟现阶段只想借助这个博客记录一点点自己学习上的心得。潜了这么长时间的水,也该出来透透气了。今天2012年7月25,我领毕业证那天是6月25,如果把走出象牙塔迈入社会比作是一个新的人生的话,那我这个..
阅读全文