题目如下: Given an array of integers arr, a lucky integer is an integer which has a frequency in the array equal to its value. Return a lucky integer in t ...
分类:
其他好文 时间:
2020-04-04 14:18:51
阅读次数:
71
1 class Solution 2 { 3 public: 4 void rotate(vector<int>& nums, int k) 5 { 6 int n = nums.size(); 7 k = k % n; 8 reverse(nums.begin(),nums.begin() + n ...
分类:
编程语言 时间:
2020-04-04 00:26:42
阅读次数:
78
一、数值型 1、整型 tinyint、smallint、mediumint、int/integer、bigint 1 2 3 4 8 特点: ①都可以设置无符号和有符号,默认有符号,通过unsigned设置无符号 ②如果超出了范围,会报out or range异常,插入临界值 ③长度可以不指定,默认 ...
分类:
其他好文 时间:
2020-04-03 23:52:14
阅读次数:
78
一 Map特性: 1 Map提供一种映射关系,其中的元素是以键值对(key-value)的形式存储的,能够实现根据key快速查找value; 2 Map中键值对以Entry类型的对象实例形式存在; 3 键,即key不可重复,但是value值可以; 4 每个键最多只能映射一个值; 5 Map接口提供了 ...
分类:
编程语言 时间:
2020-04-03 18:17:42
阅读次数:
81
leetcode 53. Maximum Subarray 链接 "leetcode" 描述 Given an integer array nums, find the contiguous subarray (containing at least one number) which has th ...
分类:
其他好文 时间:
2020-04-03 16:25:10
阅读次数:
60
一 List是有序可重复的集合 可以进行增删改查,直接看代码 1 package com.collection; 2 3 import java.util.ArrayList; 4 import java.util.Arrays; 5 import java.util.Iterator; 6 imp ...
分类:
编程语言 时间:
2020-04-03 11:58:34
阅读次数:
71
检测是否为数组 <script> // 翻转数组 function reverse(arr) { // if (arr instanceof Array) { if (Array.isArray(arr)) { var newArr = []; for (var i = arr.length - 1 ...
分类:
编程语言 时间:
2020-04-03 00:49:40
阅读次数:
69
使用析构函数,进行函数的删除 /* 析构函数 */ #include <iostream> using namespace std; class Integer { public: Integer(int i) { m_pi = new int; *m_pi = i; } ~Integer(void ...
分类:
编程语言 时间:
2020-04-02 19:53:57
阅读次数:
75
1.Shuffle机制 1.1 什么是shuffle机制 1.1.1 在hadoop中数据从map阶段传递给reduce阶段的过程就叫shuffle,shuffle机制是整个MapReduce框架中最核心的部分; 1.1.2 shuffle翻译成中文的意思为:洗牌,发牌(核心机制:数据分区,排序,缓 ...
分类:
其他好文 时间:
2020-04-02 18:08:23
阅读次数:
115
java 基本数据类型对象包装类 定义 为了方便操作基本数据类型值,Java将其封装成了对象,在对象中定义了属性和行为。用于描述该对象的类就称为基本数据类型对象包装类。 |基本数据类型|对象包装类| |: :|: :| |byte|Byte| |short|Short| |int|Integer| ...
分类:
编程语言 时间:
2020-04-02 18:06:46
阅读次数:
79