当前位置:网站首页>冒泡排序数组
冒泡排序数组
2022-07-02 18:19:00 【张 明明】
开始学JAVA了,有了C的基础刚开始挺容易的,4月份学了一点,后来各种事没能坚持,忘完了算是。慢慢来吧!
刚刷到数组,不敢跳,害怕漏掉什么重要的点!
冒泡排序!!!
public class arraysort {
public static void main(String[] args) {
int[] arr={
12,3,43,35,45,656,76,789,987,4543,311};
int temp=0;
for(int i=0;i<arr.length-1;i++){
for(int j=0;j<arr.length-i-1;j++){
if(arr[j]>arr[j+1]){
temp=arr[j+1];
arr[j+1]=arr[j];
arr[j]=temp;
}
}
}
for (int i = 0; i < arr.length; i++) {
System.out.print(arr[i]+"\t");
}
}
}
结果
边栏推荐
- 电脑使用哪个录制视频软件比较好
- PHP parser badminton reservation applet development requires online system
- Kubernetes three open interfaces first sight
- Emmet basic syntax
- Gamefi链游系统开发(NFT链游开发功能)丨NFT链游系统开发(Gamefi链游开发源码)
- "Patient's family, please come here" reading notes
- 数据降维——因子分析
- 守望先锋世界观架构 ——(一款好的游戏是怎么来的)
- 高频面试题
- 云呐|为什么要用固定资产管理系统,怎么启用固定资产管理系统
猜你喜欢
![[0701] [论文阅读] Alleviating Data Imbalance Issue with Perturbed Input During Inference](/img/c7/9b7dc4b4bda4ecfe07aec1367fe059.png)
[0701] [论文阅读] Alleviating Data Imbalance Issue with Perturbed Input During Inference

数据降维——因子分析

Web2.0的巨头纷纷布局VC,Tiger DAO VC或成抵达Web3捷径

仿京东放大镜效果(pink老师版)

The difference between interceptor and filter

ICDE 2023|TKDE Poster Session(CFP)

Introduction to the paper | application of machine learning in database cardinality estimation

使用 Cheat Engine 修改 Kingdom Rush 中的金钱、生命、星
![[论文阅读] CA-Net: Leveraging Contextual Features for Lung Cancer Prediction](/img/ef/bb48ee88d5dc6fe876a498ab53106e.png)
[论文阅读] CA-Net: Leveraging Contextual Features for Lung Cancer Prediction

聊聊电商系统中红包活动设计
随机推荐
Memory management of C
Digital scroll strip animation
Markdown basic grammar
虚拟机初始化脚本, 虚拟机相互免秘钥
[test development] takes you to know what software testing is
PHP-Parser羽毛球预约小程序开发require线上系统
Processing strategy of message queue message loss and repeated message sending
Transformation of thinking consciousness is the key to the success or failure of digital transformation of construction enterprises
以太网PHY层芯片LAN8720A简介
机器学习笔记 - 时间序列预测研究:法国香槟的月销量
MySQL advanced learning summary 8: overview of InnoDB data storage structure page, internal structure of page, row format
Usage of ieda refactor
reduce--遍历元素计算 具体的计算公式需要传入 结合BigDecimal
使用xml文件打印mybaties-log插件的方式
Mysql高级篇学习总结7:Mysql数据结构-Hash索引、AVL树、B树、B+树的对比
[0701] [论文阅读] Alleviating Data Imbalance Issue with Perturbed Input During Inference
为什么要做企业固定资产管理系统,企业如何加强固定资产管理
juypter notebook 修改默认打开文件夹以及默认浏览器
Talk about the design of red envelope activities in e-commerce system
思维意识转变是施工企业数字化转型成败的关键