摘要: 描述已知顺序表L递增有序,编写一个算法,将X插入到线性表的适当位置上,以保持线性表的有序性!样例输入512 23 34 45 5630样例输出12 23 30 34 45 56 以前链表的写法都是面向过程的,而面向对象的写法使得程序更具简洁性,当然,更重要的是OOP的思想 1 //: 在顺序表中插入元素 2 #include <iostream> 3 4 using namespace std; 5 6 class MyClass { 7 public: 8 struct Link { 9 int data; 10 Link* next; 11 ... 阅读全文
posted @ 2013-03-01 17:27 Maxwell:My Blog 阅读(619) 评论(0) 推荐(0) 编辑