摘要:1.关键代码段选择排序 1 void Selectsort(int a[], int n) 2 { 3 int i, j, nMinIndex; 4 for (i = 0; i = temp)12 break;13 a[i] = a[j]; ...
阅读全文
摘要:http://www.nowamagic.net/internet/internet_CharsetHistory.php 很久很久以前,有一群人,他们决定用8个可以开合的晶体管来组合成不同的状态,以表示世界上的万物。他们看到8个开关状态是好的,于是他们把这称为"字节"。 再后来,他们又做了一些...
阅读全文
摘要:http://blog.sina.com.cn/s/blog_6997f0150100y55v.html 图1上图描述的数据结构就是“树”,其中最上面那个圈圈A称之为根节点(root),其它圈圈称为节点(node),当然root可以认为是node的特例。树跟之前学习过的...
阅读全文
摘要:一、约瑟夫环1.数组解法int _tmain(int argc, _TCHAR* argv[]){ int i, j; int a[N] = {0}; //表示N号人还在圈中 int ptr = 0; //标记当前数到位置的指针 for (i = 0; i = 3) ...
阅读全文
摘要:1.字符串逆置(字符串回文-字符串逆置后与原字符串比较)用指针实现:int main(int argc, char* argv[]){ char *str = "hello world"; int len = strlen(str); //分配内存 //将src拷贝到新分配的内存中 ...
阅读全文
摘要:试题1:1 void test1()2 {3 char string[10];4 char* str1 ="0123456789";5 strcpy( string, str1 );6 }试题2: 1 void test2() 2 { 3 charstring[10],str1[10]; 4...
阅读全文
摘要:1 #include 2 using namespace std; 3 4 //单链表结构体 5 typedef struct student 6 { 7 int data; 8 struct student *next; 9 }node;10 11 //建立单链表12 no...
阅读全文