zoukankan
html css js c++ java
[备忘]一个二维数组的冒泡排序
对二维数组Map的第二列进行排序
int
Map[
100
][
2
];
void
BubbleSort(
int
low,
int
high)
{
int
i,j,ii;
int
exchange;
int
Temp ;
for
(i
=
low;i
<=
high;i
++
)
{
exchange
=
0
;
for
(j
=
high
-
1
;j
>=
i;j
--
)
{
if
(map[j
+
1
][
1
]
<
map[j][
1
])
{
Temp
=
map[j
+
1
][
1
];
map[j
+
1
][
1
]
=
map[j][
1
];
map[j][
1
]
=
Temp;
Temp
=
map[j
+
1
][
0
];
map[j
+
1
][
0
]
=
map[j][
0
];
map[j][
0
]
=
Temp;
exchange
=
1
;
}
}
if
(
!
exchange)
return
;
}
}
查看全文
相关阅读:
hdu 3068 最长回文
Educational Codeforces Round 1 C. Nearest vectors
Educational Codeforces Round 6 C. Pearls in a Row
poj 3304 Segments
Toy Storage
poj 2318 TOYS
CFA二级中文精讲(第2版)
探秘大香格里拉
巴西:热辣里约
巴西:性感圣保罗
原文地址:https://www.cnblogs.com/wqlblogger/p/570429.html
最新文章
oeoeoee
AngularJS学习教程
Asp.net数据库缓存依赖
Asp.net文件缓存依赖
asp.net缓存(三)
asp.net缓存(二)
asp.net缓存(一)
SQL中的delete和TRUNCATE的用法
mono for android工具下载
Linq 标准查询操作符三
热门文章
安装MongoDB
数位dp入门 hdu2089 不要62
BZOJ 1052: [HAOI2007]覆盖问题
Good Bye 2015 D. New Year and Ancient Prophecy
Educational Codeforces Round 6 D. Professor GukiZ and Two Arrays
hdu 1800 Flying to the Mars
hdu 5612 Baby Ming and Matrix games
Codeforces Round #336 (Div. 1) A
Codeforces Problem 598E
Codeforces Round #336 (Div. 2) D. Zuma
Copyright © 2011-2022 走看看