2014年7月11日
摘要: 歷程1. 寫出界面2. 用socket實現通信 阅读全文
posted @ 2014-07-11 17:42 genslow 阅读(156) 评论(0) 推荐(0) 编辑
  2012年6月3日
摘要: #include<iostream>#include<queue>using namespace std;#define VERTEX_MAX 20bool visted[VERTEX_MAX];typedef struct node { int adjvex; //顶点的位置 struct node * next; //指向下一条边的指针}EdgeNode;typedef struct vnode { char vertex; EdgeNode *firstedge;}AdjList[VERTEX... 阅读全文
posted @ 2012-06-03 23:37 genslow 阅读(445) 评论(0) 推荐(0) 编辑
  2012年4月23日
摘要: 二叉树的插入,前序,中序,后序遍历,递归求深度和节点数View Code #include<stdlib.h>#include<stdio.h>struct tree_el { int val; struct tree_el * right, * left;};typedef struct tree_el node;void insert(node ** tree, node * item) { if(!(*tree)) { *tree = item; return; } if(item->val<=(*tree)->val) inse... 阅读全文
posted @ 2012-04-23 00:50 genslow 阅读(310) 评论(0) 推荐(0) 编辑
  2012年4月7日
摘要: So here's a simpler challenge, some ways to be a better programmer in6 minutes. You've got 6 minutes, right? Go for it!Use a bigger font size.This is ridiculously easy -- but it works.Go to your favourite IDE, and crank the font-size up. I switched from 10pt to 14 pt. The difference is that 阅读全文
posted @ 2012-04-07 20:27 genslow 阅读(186) 评论(0) 推荐(0) 编辑
摘要: Being a good programmer can mean many things to different people. For some, it can mean you are a good problem solver, for others it means you are the master of a particular programming language and still some would argue that neither of those things can make you a good developer. Being a good pr... 阅读全文
posted @ 2012-04-07 20:26 genslow 阅读(181) 评论(0) 推荐(0) 编辑
  2012年4月5日
摘要: 看了算法导论,有点迷糊。照着为代码敲出来的C。数组都前移了一位,就实现 了。 主要是计算前缀数组的有点抽象。简单的说就是,next[j]表示当模式串t中第j个字符与主串中相应字符(即Si)不相等时,模式串中需重新和主串中该字符Si进行比较的字符位置k,即下次开始比较Si与Tk。我们希望子串能尽量快... 阅读全文
posted @ 2012-04-05 22:30 genslow 阅读(196) 评论(0) 推荐(0) 编辑
  2012年3月26日
摘要: 原创作品,允许转载,转载时请务必以超链接形式标明文章原始出处、作者信息和本声明。否则将追究法律责任。http://ticktick.blog.51cto.com/823160/596179你了解 #include 某个 .h 文件后,编译器做了哪些操作么? 你清楚为什么在 .h文件中定义函数实现的话... 阅读全文
posted @ 2012-03-26 11:49 genslow 阅读(201) 评论(0) 推荐(0) 编辑
摘要: 根据数据结构书本上的为代码实现的View Code #include#include #include #define MAX_STACK_SIZE 100#define EXIT_ROW 9#define EXIT_COL 9int maze[10][10] = { {1,0,1,1... 阅读全文
posted @ 2012-03-26 00:21 genslow 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 1.数制转换2.括号匹配3.表达式求值#include <stdio.h>#include <malloc.h>#include <string.h>#include <stdlib.h>#include <windows.h>#define TRUE 1#define FALSE 0#define OK 1#define ERROR 0#define INFEASIBLE -1#define OVERFLOW -2char JJ[]={"0123456789ABCDEF"};typedef struct tagW 阅读全文
posted @ 2012-03-26 00:14 genslow 阅读(301) 评论(0) 推荐(0) 编辑
  2012年3月21日
摘要: 根据数据结构的算法。 可以将10进制转换为2-16进制View Code #include<stdio.h>#include<string.h>#include<stdlib.h>char JJ[]={"0123456789ABCDEF"};typedef struct node{ struct node *next; char data;}stack;int isEmpty(stack *s);void CreatStack(stack **s);void Push(stack **s,char x);char Pop(stack ** 阅读全文
posted @ 2012-03-21 14:28 genslow 阅读(356) 评论(0) 推荐(0) 编辑