摘要: 实现原理:方法1:使用list,通过list.contains()作为循环判断的条件,实现无重复的add方法2:使用两组数组,all存储所有可取值,result存储结果,result依次从all中取值,all长度递减,通过索引实现all中始终保持取完后剩下的元素分析:法1在最坏情况下会重复循环,法2通过保证每次都能取到值,很大程度上提高了效率代码比较:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Diagnostics;namespace 基本语法{ 阅读全文
posted @ 2013-05-20 22:21 leowww 阅读(241) 评论(2) 推荐(0) 编辑