当前位置:网站首页>Bubble sort array
Bubble sort array
2022-07-02 19:28:00 【Zhangmingming】
Start learning JAVA 了 , With C At first, it's easy to build the foundation of ,4 I learned a little in August , Later, all kinds of things failed to persist , Forget it, it's . Take your time !
Just brush to the array , Dare not jump , Afraid to miss something important !
Bubble sort !!!
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");
}
}
}
result
边栏推荐
- Quanzhi A33 uses mainline u-boot
- 教程篇(5.0) 10. 故障排除 * FortiEDR * Fortinet 網絡安全專家 NSE 5
- 仿京东放大镜效果(pink老师版)
- 数字滚动带动画
- Gamefi chain game system development (NFT chain game development function) NFT chain game system development (gamefi chain game development source code)
- Digital scroll strip animation
- High frequency interview questions
- 冒泡排序数组
- How performance testing creates business value
- 452-strcpy、strcat、strcmp、strstr、strchr的实现
猜你喜欢
Yolov3 trains its own data set to generate train txt
Data dimensionality reduction factor analysis
The difference between interceptor and filter
《架构整洁之道》读书笔记(下)
云呐|为什么要用固定资产管理系统,怎么启用固定资产管理系统
Talk about the design of red envelope activities in e-commerce system
[100 cases of JVM tuning practice] 02 - five cases of virtual machine stack and local method stack tuning
仿京东放大镜效果(pink老师版)
Excel查找一列中的相同值,删除该行或替换为空值
《重构:改善既有代码的设计》读书笔记(上)
随机推荐
When converting from list to map, if a certain attribute may cause key duplication and exceptions, you can set the way to deal with this duplication
《病人家属,请来一下》读书笔记
《代码整洁之道》读书笔记
C的内存管理
[paper reading] Ca net: leveraging contextual features for lung cancer prediction
End to end object detection with transformers (Detr) paper reading and understanding
【测试开发】软件测试—概念篇
Introduction of Ethernet PHY layer chip lan8720a
Yunna | why use the fixed asset management system and how to enable it
数据降维——主成分分析
预处理和预处理宏
Use cheat engine to modify money, life and stars in Kingdom rush
高级性能测试系列《24. 通过jdbc执行sql脚本》
Windows2008R2 安装 PHP7.4.30 必须 LocalSystem 启动应用程序池 不然500错误 FastCGI 进程意外退出
横向越权与纵向越权[通俗易懂]
Typescript 之 快速入门
思维意识转变是施工企业数字化转型成败的关键
股票证券公司排名,有安全保障吗
Imitation Jingdong magnifying glass effect (pink teacher version)
Why should we build an enterprise fixed asset management system and how can enterprises strengthen fixed asset management