seth-shi
Follow
0
Followers
0
Followings
Patron
Home
Archives
排序
Latest
Hottest
Most Commented
吾有一术,名曰快排.
最近刷leet-code的一到题目时,找到第k大的数字,需要对一个数组进行排序. 发现自己只会最基础的冒泡排序,插入排序. 然后就去补习了一下插入排序,对着网上给的动态图,写了一份自己的快速排序,代码都差不多. Copy // 1. 选择一个基准数量(可选第一个…
数据结构
1 min
4 years ago
排序算法-桶排序
桶排序很适用于有 0~100 个数,然后打乱顺序,重新分配。不过如果给定的数据范围差距很大,桶排序的算法效率变低. 步骤 申请 n 个桶,根据需求 遍历一个给定的数组,找到最大值和最小值 遍历数组,假设遍历的值为num, 按照公式floor((num - min) / n)即可…
排序
1 min
5 years ago
Ownership of this blog data is guaranteed by blockchain and smart contracts to the creator alone.
Blockchain ID
#51407
Owner
0x43bdcdfe2758f3664c5bfd297b4bf57fc453ac15
Transaction Hash
Creation 0x5d230488...fa2f33f7bc
Last Update 0xca171ebf...d99bc627d3
IPFS Address
ipfs://bafkreifknwgcum2zyotppbaeab4hyowgf24x23ofdem7llbne574k6dql4