Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lectures/11-sorting/code/src/com/kunal/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ static int getMaxIndex(int[] arr, int start, int end) {
static void bubble(int[] arr) {
boolean swapped;
// run the steps n-1 times
for (int i = 0; i < arr.length; i++) {
for (int i = 0; i < arr.length - 1; i++) {
swapped = false;
// for each step, max item will come at the last respective index
for (int j = 1; j < arr.length - i; j++) {
Expand Down