目录 1.桶排序思想 2.算法过程 3.算法实现代码 在开头安利一个可视化网站: https://www.cs.usfca.edu/~galles/visualization/Algorithms.html 这上面有排序算法的可视化实现,可结合下文算法过程对照着图学习。 思想:将待排序集合中处于同一 ...
分类:
编程语言 时间:
2021-02-20 11:44:16
阅读次数:
0
https://www.acwing.com/problem/content/1144/ #include <bits/stdc++.h> using namespace std; #define IO ios::sync_with_stdio(false);cin.tie(0); cout.tie ...
分类:
其他好文 时间:
2021-02-17 14:57:50
阅读次数:
0
回溯算法 这部分主要是学习了 labuladong 公众号中对于回溯算法的讲解 刷了些 leetcode 题,在此做一些记录,不然没几天就忘光光了 总结 概述 回溯是 DFS 中的一种技巧。回溯法采用 试错 的思想,尝试分步的去解决一个问题,在分步解决问题的过程中,当它通过尝试发现现有的分步答案不能 ...
分类:
编程语言 时间:
2021-02-16 12:14:33
阅读次数:
0
Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, and return an array of the non-overlapping intervals ...
分类:
其他好文 时间:
2021-02-16 12:04:54
阅读次数:
0
注意不满$4$位的话要补成$4$位。 string s; set<int> S; int main() { cin>>s; while(s.size()<4) s='0'+s; while(true) { sort(s.begin(),s.end(),greater<char>()); string ...
分类:
其他好文 时间:
2021-02-15 12:21:49
阅读次数:
0
排序算法的介绍 排序也称排序算法(Sort Algorithm),排序是将一组数据,依指定的顺序进行排列的过程。 排序的分类: 1) 内部排序: 指将需要处理的所有数据都加载到内部存储器(内存)中进行排序。 2) 外部排序法: 数据量过大,无法全部加载到内存中,需要借助外部存储(文件等)进行排序。 ...
分类:
编程语言 时间:
2021-02-15 12:19:55
阅读次数:
0
题意 如题目所示 思路 遍历字符串建立一个哈希表来统计每个字符出现的次数,然后再从头遍历字符串进行查询即可 代码 class Solution { public: char firstUniqChar(string s) { if(s.empty()) { return ' '; } unorder ...
分类:
其他好文 时间:
2021-02-15 11:50:39
阅读次数:
0
Oracle表连接方法有四种: 排序合并连接(Sort Merge Join) 嵌套循环连接(Nested Loops Join) 哈希连接(Hash Join) 笛卡尔积(Cartesian Product) 排序合并连接(Sort Merge Join) 排序合并连接是将连接的两个表使用连接列排 ...
分类:
其他好文 时间:
2021-02-09 12:42:10
阅读次数:
0
如果提供比较,则使用委托表示的方法对列表中的元素进行排序。如果comparison为null,则抛出ArgumentNullException。 此方法使用数组.排序,其应用自省排序,如下所示: 如果分区大小小于或等于16个元素,则使用插入排序算法 如果分区数超过2logn,其中n是输入数组的范围, ...
class Solution { public: vector<vector<int>> threeSum(vector<int>& nums) { int n=nums.size(); vector<vector<int>>ans; if(n<3) return{}; sort(nums.begi ...
分类:
其他好文 时间:
2021-02-08 11:52:34
阅读次数:
0