摘要: 二分查找 1 public class BinarySearch 2 { 3 public static int Search(List<int> list,int key) 4 { 5 int low = 0; 6 int high = list.Count - 1; 7 8 while (low <= high) 9 {10 var middle = (low + high) / 2;11 ... 阅读全文
posted @ 2013-01-28 21:15 binfire005 阅读(523) 评论(0) 推荐(0) 编辑
摘要: 【交换排序】:冒泡排序,快速排序 【选择排序】:简单选择排序,堆排序【插入排序】:简单插入排序,希尔排序 ;归并排序一:交换排序 public class BubbleSort { public static List<int> Sort(List<int> list) { int temp = 0; //要比较的次数 n-1 for (int i = 0; i < list.Count - 1; i++) { //从底部开始 ... 阅读全文
posted @ 2013-01-28 21:13 binfire005 阅读(584) 评论(0) 推荐(0) 编辑
摘要: 一:创建对象: //对象封装原始模式 var Cat = { name: '', color: '', eat: function () { } }; function eat() { console.log("test"); } var cat1 = { name: "binfire", color: "red", eat: eat };二:构建类: //对象封装 function Cat(name, color) { ... 阅读全文
posted @ 2013-01-28 21:00 binfire005 阅读(589) 评论(0) 推荐(0) 编辑