面向对象风格的单链表排序
摘要://面对对象风格的单链表排序.//现在的主要问题是,排序的列表中不能出现0,原因是与NULL冲突. #include <iostream> using namespace std; const long int MAX = 2147483647; //长整形的最大值,即 (2^31)-1,在当前编译
阅读全文
posted @
2021-08-30 21:49
学群
阅读(43)
推荐(0)
错排问题(Derangement)
摘要:使用了两种错排问题算法,并对其进行了时间分析。 #include <iostream> #include <ctime> using namespace std; int power(int a, int b) { int sum = a; while (b > 1) { sum *= a; --b
阅读全文
posted @
2021-08-20 19:26
学群
阅读(260)
推荐(0)
单链表值删除节点(C语言环境下)
摘要:结构体节点: typedef struct student { int num; //学号 int score; //分数 char name[20]; struct student *next;//指针域 }STU; demo: 1、 void link_delete_num(STU **p_he
阅读全文
posted @
2021-08-10 11:08
学群
阅读(460)
推荐(0)