摘要: 从上一章的问题:生成[0, maxval]范围内m个随机整数的有序序列,不允许重复。实现伪代码:initialize set S to emptysize = 0while size < m do t = bigrand() %d maxval if t is not in S insert t into S size ++print the elements of S in sorted order将生成的数据结构称为IntSet,指整数集合S。接口定义如下: 1 //Intset.h 接口定义头文件 2 typedef int bool; 3 #define true 0 ... 阅读全文
posted @ 2012-09-04 23:03 大兔子_快跑 阅读(396) 评论(0) 推荐(0)