posted @ 2010-09-22 15:42 KurtWang 阅读(6117) 评论(1) 推荐(0) 编辑
摘要:
#include "stdafx.h" struct Node { int value; Node * next; }; //不考虑删除节点为尾节点 void deleteNode(Node * pCurrent) { if(pCurrent != NULL) { if(pCurrent->next != NULL) { Node * pTemp = pCurrent->... 阅读全文
摘要:
// 3_3.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include //递归 int distance(const char * str1, int start1, int end1, const char * str2, int start2, int end2)... 阅读全文
posted @ 2010-09-22 14:52 KurtWang 阅读(410) 评论(0) 推荐(0) 编辑
摘要:
// 3_2.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" char c[10][10]= { "", "", "abc", "def", "jkl", "mno", "pqrs", "tuv", "wxyz", }; int total[10] = {0,0,3,3,3,3,3,4,3,4}; int number[4] =... 阅读全文
posted @ 2010-09-20 23:21 KurtWang 阅读(1208) 评论(0) 推荐(0) 编辑
摘要:
//空间换时间 bool func(char * s1, char * s2) { assert(s1); assert(s2); char * temp = new char[strlen(s1)*2 + 1]; strcpy(temp,s1); strcat(temp,s1); if(strstr(temp, s2) != NULL) return true; else ... 阅读全文
posted @ 2010-09-20 22:32 KurtWang 阅读(359) 评论(0) 推荐(0) 编辑