mirror of
https://github.com/krahets/hello-algo.git
synced 2025-11-02 21:24:53 +08:00
Format C, C++, C#, Go, Java, Python, Rust code.
This commit is contained in:
@ -18,7 +18,7 @@ public class bucket_sort {
|
||||
// 1. 将数组元素分配到各个桶中
|
||||
foreach (float num in nums) {
|
||||
// 输入数据范围 [0, 1),使用 num * k 映射到索引范围 [0, k-1]
|
||||
int i = (int) (num * k);
|
||||
int i = (int)(num * k);
|
||||
// 将 num 添加进桶 i
|
||||
buckets[i].Add(num);
|
||||
}
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
* Author: hpstory (hpstory1024@163.com)
|
||||
*/
|
||||
|
||||
namespace hello_algo.chapter_sorting;
|
||||
namespace hello_algo.chapter_sorting;
|
||||
|
||||
public class heap_sort {
|
||||
/* 堆的长度为 n ,从节点 i 开始,从顶至底堆化 */
|
||||
|
||||
Reference in New Issue
Block a user