Skip to content

Commit 7405ead

Browse files
committed
Runtime: 2 ms (Top 77.93%) | Memory: 42.7 MB (Top 83.40%)
1 parent 801816b commit 7405ead

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

scripts/algorithms/P/Pancake Sorting/Pancake Sorting.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Runtime: 2 ms (Top 77.93%) | Memory: 42.7 MB (Top 83.40%)
12
// BruteForce Approach!
23
// Author - Nikhil Sharma
34
// LinkedIn - https://www.linkedin.com/in/nikhil-sharma-41a287226/
@@ -17,7 +18,7 @@ public List<Integer> pancakeSort(int[] arr) {
1718
}
1819
return list;
1920
}
20-
21+
2122
static int findIndex(int[] arr, int value) {
2223
for(int i=0; i<arr.length; i++) {
2324
if(arr[i] == value){
@@ -26,7 +27,7 @@ static int findIndex(int[] arr, int value) {
2627
}
2728
return 0;
2829
}
29-
30+
3031
static void reverse(int[] arr, int maxIndex) {
3132
int l = 0;
3233
while(l<maxIndex) {
@@ -37,4 +38,4 @@ static void reverse(int[] arr, int maxIndex) {
3738
maxIndex--;
3839
}
3940
}
40-
}
41+
}

0 commit comments

Comments
 (0)