码迷,mamicode.com
首页 >  
搜索关键字:radix    ( 316个结果
Counting Sort and Radix Sort
Counting Sort 计数排序适用于数据量很大,但是数据类别很少的情况,可以做到线性时间。 举例来看:如果有100万个字符串,但只有cat, dog, person三种类型,采用基于比较的排序方式,可以做到$NlogN$,计数排序采用了一种完全不同的思想: 新建一个counts[3],记录每种 ...
分类:其他好文   时间:2020-06-24 10:31:57    阅读次数:52
dart 格式化输出
类似于保留几位小数,直接 n.toStringAsFixed()例如:1.toStringAsFixed(3); // 1.000(4321.12345678).toStringAsFixed(5); // 4321.123461000000000000000000000.toStringAsFix ...
分类:其他好文   时间:2020-06-16 23:07:35    阅读次数:247
【PAT 甲级】1010 Radix (25分)
题意:给一个已知进制的数N1,问另一个数N2是否存在某一进制表示和N1相等。 思路(debug历程):将N1转化成10进制数,枚举进制计算N2,与N1进行比较。 先开始想到的是从2开始向上枚举到36,后来发现36不对。发现枚举上界应该是N1+1(这个看网上的证明吧https://blog.csdn. ...
分类:其他好文   时间:2020-06-14 14:39:17    阅读次数:53
JS实现HTML实体与字符的相互转换
超级有用。 function stringToEntity(str,radix){ let arr=str.split('') radix=radix||0 let tmp=arr.map(item=> `&#${(radix?'x'+item.charCodeAt(0).toString(16): ...
分类:Web程序   时间:2020-06-10 09:14:39    阅读次数:121
基数排序
#include<stdio.h> #include<stdlib.h> void print_arr(int arr[],int N) { int i; for(i=0;i<N;i++) { printf("%d ",arr[i]); } } void radix_sort(int A[],int ...
分类:编程语言   时间:2020-06-03 17:36:42    阅读次数:76
PAT 1010 Radix (25分) radix取值无限制,二分法提高效率
题目 Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer is yes, if 6 is a decimal number and 110 i ...
分类:其他好文   时间:2020-05-19 01:04:00    阅读次数:58
基数排序
基数排序(radix sort): 对个位数先排序,再对十位数排序,以此类推。。 如果数据不满足位数相同,要对不够位数的数字前面补0(或者做类似处理)。 时间复杂度O(nk)其中n为数字个数,k为最多的数字位数。 void RadixSort(vector<int>& nums){ int maxD ...
分类:编程语言   时间:2020-05-14 09:13:43    阅读次数:87
Radix Sort
To illustrate the radix sort algorithm we will sort the sequence S0 = {32, 100, 11, 554, 626, 122, 87, 963, 265, 108, 9}. We start by distributing ele ...
分类:其他好文   时间:2020-05-01 00:45:46    阅读次数:56
All about that base
The base (or radix) of a positional numeral system is the number of symbols that can be used to represent a number in that system. The base 1010 syste ...
分类:其他好文   时间:2020-04-20 11:47:10    阅读次数:74
Java实现基数排序(解决负数也可以排序)
/* * 基数序 解决不能负数的问题 */ public static void negative_radix_sortin(int[] str) { // 桶 10个桶 每个桶的最大容量默认为数组长度 int[][] bucket = new int[10][str.length]; // 每个桶 ...
分类:编程语言   时间:2020-04-11 23:47:10    阅读次数:206
316条   上一页 1 2 3 4 ... 32 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!