摘要: 这道题一个容易思考的思路是把所有的排列都存储下来,但是由于最大的数组长度是1024,因此1024!种可能肯定超时。可以用模拟的方法找到一个比较节省时间的方法 如果有a1---an个元素,分四步 1从an开始逆序向前,直到找到一个ai,使a[i-1]#includeusing namespace st... 阅读全文
posted @ 2010-04-06 14:08 梦涵 阅读(434) 评论(0) 推荐(0) 编辑
摘要: [zz]from http://peirenlei.javaeye.com/blog/505497 list对象的声明构造(): A. listc0; //空链表 B. listc1(3); //建一个含三个默认值是0的元素的链表 C. listc2(5,2); //建一个含五个元素的链表,值都是2... 阅读全文
posted @ 2010-04-06 13:01 梦涵 阅读(636) 评论(0) 推荐(0) 编辑
摘要: Last semester I didn’t grasp the idea of linked list.Here is a review about the basic manipulation of the linked list #include<iostream>#include<string>using namespace std;int n;struct num... 阅读全文
posted @ 2010-04-06 12:59 梦涵 阅读(117) 评论(0) 推荐(0) 编辑