
leetcode刷题
面向面试leetcode刷题
Whisper~~~
00后 后端开发工程师
展开
-
多数元素Leetcode
多数元素方法一(哈希表)利用哈希表来存储每一个元素以及元素出现的次数,当哈希表已经有该元素时,取出值并加一放入哈希表中,最后只需要遍历哈希表,找到值大于等于数组长度一半的键,返回即可。public static int majorityElement(int[] nums) { Map<Integer,Integer > map = new HashMap<Integer,Integer >(); for(int i=0;i<nums.l原创 2021-11-06 16:05:51 · 109 阅读 · 0 评论 -
最小生成树问题
最小生成树原创 2021-12-04 00:27:50 · 157 阅读 · 0 评论 -
关于_int128
#include<bits/stdc++.h>using namespace std;inline __int128 read() { __int128 x = 0, f = 1; char ch = getchar(); while (ch < '0' || ch > '9') { if (ch == '-') f = -1; ch = getchar(); } while (ch >= '0' && ch <= '9') {原创 2021-12-04 00:20:06 · 705 阅读 · 0 评论 -
矩阵快速幂
矩阵快速幂,计算范围较大的矩阵乘法原创 2021-12-03 23:51:51 · 139 阅读 · 0 评论 -
快速幂讲解
快速幂,用于计算范围较大的阶乘原创 2021-12-03 23:47:45 · 243 阅读 · 0 评论