public
static
void
bubbleSort (
int
[] data)
{
for
(
int
i = data.length -
1
; i >=
0
; i--)
{
// bubble up
for
(
int
j =
0
; j <= i -
1
; j++)
{
if
(data[j] > data[j +
1
])
swap(data, j, j +
1
);
}
}
}
2. I'm not really using my skills in school yet but I will definitely utilize
them next trimester in my computer science class.
No comments:
Post a Comment