先放一段冒泡排序的代码 public class Test { public void bubbleSort(int[] a){ if (a.length<=1){return;} for (int i = 0; i < a.length; i++) { boolean flag = false; ...
分类:
编程语言 时间:
2020-12-14 13:21:56
阅读次数:
4
//冒泡排序 //1.比较数组中,两个相邻的元素,如果第一个比第二个大,则它们交换位置。 //2.每一次比较,都会产生一个最大或者最小的元素。 //3.下一轮可以少一次排序。 //4.知道循环结束 //实例: public class Demo1 { public static void main( ...
分类:
编程语言 时间:
2020-12-14 12:47:20
阅读次数:
8
Remote Dictionary Server(Redis)是一个开源的使用ANSI C语言编写、支持网络、可基于内存亦可持久化的日志型、Key-Value 数据库,并提供多种语言的API。它通常被称为数据结构服务器,因为值(value)可以是 字符串(String), 哈希(Map), 列表(l ...
分类:
其他好文 时间:
2020-12-10 11:28:01
阅读次数:
8
Given an array of integers, find out whether there are two distinct indices i and j in the array such that the absolute difference between nums[i] and ...
分类:
编程语言 时间:
2020-12-10 11:13:48
阅读次数:
6
利用数组求和,以及找出数组中组大的元素 //数组使用 public class ArrayDemo03 { public static void main(String[] args) { int[] arrays = {1,2,3,4,5}; for (int i = 0; i <arrays.l ...
分类:
编程语言 时间:
2020-12-10 11:09:36
阅读次数:
3
opengl 学习 之 13 lesson 简介 法向量纹理,让纹理显示的更逼真? link http://www.opengl-tutorial.org/uncategorized/2017/06/07/website-update/ http://www.opengl-tutorial.org/ ...
分类:
其他好文 时间:
2020-12-08 12:29:08
阅读次数:
6
1、利用stream对数据进行分组并求和 public static void main(String[] args) { List<String> items = Arrays.asList("apple", "apple", "banana", "apple", "orange", "banan ...
分类:
编程语言 时间:
2020-12-07 12:34:17
阅读次数:
8
1. 概述 在本教程中,我们将介绍 Apache Beam 并探讨其基本概念。 我们将首先演示使用 Apache Beam 的用例和好处,然后介绍基本概念和术语。之后,我们将通过一个简单的例子来说明 Apache Beam 的所有重要方面。 2. Apache Beam是个啥? **Apache B ...
分类:
Web程序 时间:
2020-12-07 12:08:06
阅读次数:
7
Given n non-negative integers a1, a2, ..., an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endp ...
分类:
其他好文 时间:
2020-12-04 11:23:41
阅读次数:
6
题意 给定m个长度不定的区间,取两个长度为k的区间,m个区间中每个区间的贡献为与两个长度为k的区间的交的较大值。求最大贡献。 思路 可以看到对于两个区间来说,当区间中心越靠近时区间交越大。所以我们把m个区间按区间中心排序,然后对于两个长度为k的区间一个取前一部分进行相交,一个取后一部分取交。预处理出 ...
分类:
其他好文 时间:
2020-12-04 11:17:49
阅读次数:
7