码迷,mamicode.com
首页 >  
搜索关键字:merge sort    ( 17185个结果
Insertion Sort and Merge Sort
Insertion Sort(插入排序) 思路:for 循环遍历数组中的每一个数 用while将每次遍历到的数于左侧的数进行对比,将小的排到左边 void InsertionSort(int*A, int n){ int key,i=0,p; for(p=0;p<n;p++){ key=A[p]; ...
分类:其他好文   时间:2021-04-26 13:48:01    阅读次数:0
JavaScript基础
一、forEach <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <script type="text/javascript"> // forEach() 需要一个函数作为参数 // IE8及以下的浏览器不支 ...
分类:编程语言   时间:2021-04-24 13:21:52    阅读次数:0
golang image.DecodeConfig image: unknown format
golang获取上传图片的宽和高: package main import ( "fmt" "image" "io/ioutil" "os" "path/filepath" ) const dir_to_scan string = "/home/da/to_merge" func main() { ...
分类:其他好文   时间:2021-04-23 11:57:25    阅读次数:0
迭代器,sum,max,min、列表排序
1、列表的排序 a = [1,2,3,4,9,7,6,5,8] a.sort() #默认升序排列,对象不变,元素排序 a.sort(reverse=True) #降序排序 import random #打乱,随机排序 random.shuffle(a) 用法二、 a = sorted(a) #默认升 ...
分类:编程语言   时间:2021-04-22 15:55:48    阅读次数:0
git
There is no tracking information for the current branch. Please specify which branch you want to merge with. See git-pull(1) for details. git pull <re ...
分类:其他好文   时间:2021-04-22 15:28:20    阅读次数:0
统计tomcat的access日志
统计tomcat的access日志的ip次数,并按次数排序 awk '{sum[$1]++}END{for(i in sum) print i "\t" sum[i]}' localhost_access_log.* | sort -n -k2 统计某个接口的调用时间 awk '{if($7~/.* ...
分类:数据库   时间:2021-04-21 12:18:10    阅读次数:0
6.树(下)
树(下) 1.平衡二叉树 平衡因子:左子树和右子树的高度差; AVL树仍是二叉查找树,对任意结点其平衡因子绝对值不超过1 1.1 建树 class ANode { int value; ANode left; ANode right; int height;? public ANode(int va ...
分类:其他好文   时间:2021-04-20 15:38:51    阅读次数:0
十大经典排序之基数排序(C++实现)
#基数排序 也是采用分桶的思想,但是加入了按位比较的思想(可以理解为每位进行一次计数排序) 思路: 计算数列中最大位数 按位数循环处理每位的排序 代码实现: #include<iterator> #include<iostream> #include<vector> using namespace ...
分类:编程语言   时间:2021-04-20 15:17:05    阅读次数:0
冒泡排序
package com.smile.test.sort.bubble; /** * 冒泡排序 时间复杂度O(n^2) */ public class Bubble { static void sort(Comparable[] a){ for (int i = a.length-1; i>0; i- ...
分类:编程语言   时间:2021-04-16 12:06:55    阅读次数:0
JavaScript数组排序sort()
###数组排序直接使用sort() var values = [0,3,2,15,16,10]; //sort()排序 升序或者降序 默认升序 values.sort(); //[0, 10, 15, 16, 2, 3] 发现结果并不是想要的 原因: //比较时会转换成字符串 比较的是ASCLL编码 ...
分类:编程语言   时间:2021-04-16 11:56:17    阅读次数:0
17185条   上一页 1 ... 9 10 11 12 13 ... 1719 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!