首页 > TAG信息列表 > Integer1

剑指 Offer 59 - II. 队列的最大值

剑指 Offer 59 - II. 队列的最大值 思路 对于一个队列 :7 7 2 3 4 0 1 9 可以发现,在9出队列之前,2,3,4,0,1 这些数字对最大值没有贡献 对于队列:7 7 2 3 4 可以发现,在4出队列之前,2,3 这些数字对于最大子没有贡献 所以可以创建一个单调递减的队列,用于存放局部最大值 例如,对于4来说,单调队列

Integer 类型的 == 和 equals 的陷阱

        @Test     public void testEquals() {         int int1 = 12;         int int2 = 12;                  Integer integer1 = new Integer(12);         Integer integer2 = new Integer(12);         Integer intege

初识八大基本数据类型的包装类——Java面向对象基础(25)

一、总括 * 八大基本数据类型的包装类:将基本数据类型封装了类(引用类型) * 基本数据类型 包装类 * byte -- Byte * short -- Short * int -- Integer * long -- Long * float -- Float * d

算术运算

//算术运算 #include <stdio.h> //function main begins program execution int main(void) { int integer1,integer2;//定义两个整数 printf("请输入两个整数:");//prompt scanf("%d %d",&integer1,&integer2);//输入两个整数 puts(" "); printf(&quo

两个整数相加

//两个整数的加法 #include <stdio.h> //主函数开始执行 int main(void) { int integer1;//定义第一个整数 int integer2;//定义第二个整数 printf("Enter first integer1\n"); scanf("%d",&integer1);//输入第一个整数 printf("Enter second integer2\n"); scanf(&q

可变数组Vector

package com.demon.languang.business.rest; import java.util.Vector; public class DemonTest { @SuppressWarnings({ "unchecked", "rawtypes" }) public static void main(String[] args) { Vector v1 = new Vector(); Integer integer1= new Inte

32.把数组排成最小的数

题目描述:   输入一个正整数数组,把数组里所有数字拼接起来排成一个数,打印能拼接出的所有数字中最小的一个。例如输入数组{3,32,321},则打印出这三个数字能排成的最小数字为321323。 思路分析:   要想将数组里所有的数拼起来排成一个数,还得是最小的,那么我们在拼接的过程中需要比较的

Integer判等的陷阱:你知道Integer内部高速缓冲区IntegerCache吗?

https://blog.csdn.net/magician_Code/article/details/51469101   我们先来看看下面代码的运行情况: public static void main(String[] args){ // TODO Auto-generated method stub Integer integer1; Integer integer2; integer1 = new Integer(10); integer2