算法模型: 随机顶点 ,顶点存入S集, 剩余顶点存入T集合每次遍历顶点。 取一条可以连接S与T最短边e, 直到所有顶点所有增加S#include#include#define INF 1low[j]&&!vis[j]) //寻找最小边 { pos = j; temp = l...
分类:
其他好文 时间:
2015-07-27 09:19:35
阅读次数:
115
$("#btnExport").click(function(e) { window.open('data:application/vnd.ms-excel,' + $('#dvData').html()); e.preventDefault();});
分类:
其他好文 时间:
2015-07-27 00:15:01
阅读次数:
101
希尔排序
package ShellSort;import Utils.SortUtils;public class Demo { public static void shellSort(int[] a){ int temp,j;
int increment = a.length; do{
increment = incr...
分类:
编程语言 时间:
2015-07-26 22:44:00
阅读次数:
360
排序思路:在要排序的一组数中,选出最小的一个数与第一个位置的数交换;然后在剩下的数当中再找最小的与第二个位置的数交换,如此循环。算法实现: public static void selectSort(int arr[]){ int temp; for(int i =...
分类:
编程语言 时间:
2015-07-26 22:36:30
阅读次数:
229
冒泡排序: 对数组的中的数据,依次比较相邻两数的大小。如果前面的数据大于后面的数据,就交换这两个数。时间复杂度O(n^2) 1 function bubble(array){ 2 var temp; 3 for(var i=0; iarr[j+1]){ 6 ...
分类:
编程语言 时间:
2015-07-26 20:49:17
阅读次数:
154
1 #include 2 using namespace std; 3 4 5 //function template 6 template 7 void sort(T* array,int len,bool(*compare)(T& a,T& b)) 8 { 9 10 T temp;...
分类:
其他好文 时间:
2015-07-26 17:09:09
阅读次数:
85
Iencounter this problem several times, the way to get around this is to give"Everyoneor Network Service" permission to "C:\windows\temp" folder. I gav...
分类:
数据库 时间:
2015-07-26 14:03:49
阅读次数:
182
冒泡,简单选择,直接插入这三种排序都是简单排序。工具类package Utils;import java.util.Arrays;public class SortUtils {
public static void swap(int[] a,int i,int j){
int temp = a[i];
a[i] = a[j];
a[j] =...
分类:
编程语言 时间:
2015-07-26 00:32:40
阅读次数:
184
mysql> #查询每个栏目最贵的商品mysql> select goods_id,shop_price,cat_id from (select goods_id,shop_price,cat_id from goods order by shop_price desc) as temp group...
分类:
数据库 时间:
2015-07-25 22:48:23
阅读次数:
248
/*对给定数组进行排序{5,7,2,8,9,1,3,4}*/class ArrayTest2{/*选择排序内循环结束一次,最值出现在头角标位置上*/public static void SelectSort(int[] arr){for(int x=0;xarr[y]){/*int temp=arr...
分类:
编程语言 时间:
2015-07-25 16:39:32
阅读次数:
130