Skip to content

Commit 6945ebe

Browse files
authored
Merge branch 'master' into patch-7
2 parents 62595f6 + b0ccec9 commit 6945ebe

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Maths/Area.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,11 @@ private static double surfaceAreaRectangle(double length, double width) {
7474
}
7575

7676
/**
77-
* Calculate surface of a cylinder
77+
* Calculate surface area of a cylinder
7878
*
7979
* @param radius radius of the floor
8080
* @param height height of the cylinder.
81+
* @return volume of given cylinder
8182
*/
8283
private static double surfaceAreaCylinder(double radius, double height) {
8384
return 2 * (Math.PI * radius * radius + Math.PI * radius * height);

Sorts/BubbleSort.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ class BubbleSort implements SortAlgorithm {
1818
*/
1919
@Override
2020
public <T extends Comparable<T>> T[] sort(T[] array) {
21-
for (int i = 0, size = array.length; i < size - 1; ++i) {
21+
for (int i = 1, size = array.length; i < size; ++i) {
2222
boolean swapped = false;
23-
for (int j = 0; j < size - 1 - i; ++j) {
23+
for (int j = 0; j < size - i; ++j) {
2424
if (greater(array[j], array[j + 1])) {
2525
swap(array, j, j + 1);
2626
swapped = true;

0 commit comments

Comments
 (0)