摘要:
这里参考的是大话数据结构里的冒泡排序,冒泡排序的基本思想是:两两比较相邻记录的关键字,如果反序则交换,直到没有反序的记录为止。冒泡法的效率是非常低下的。现在贴上代码: #include<iostream> using namespace std; int main() { int a[] = { 1 阅读全文
摘要:
#include <iostream>using namespace std; class Node//节点{ public: int data; Node* next; public: Node() :data(0), next(NULL){}}; class List//链表{public: L 阅读全文