Skip to content

Commit 30260ce

Browse files
[autofix.ci] apply automated fixes
1 parent 62d9da8 commit 30260ce

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

app/src/main/java/assignment/App.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ public static int get(LinkedList list, int index) {
66
LinkedList.Node item = list.head; // O(1)
77
int length = list.length();
88
for (int i = 0; i < length; i++) { // O(n)
9-
if(i==index){
9+
if (i == index) {
1010
return item.data;
11-
} // This would make it so that if index is in the bounds of length then it will return the data other wise return null right?
11+
} // This would make it so that if index is in the bounds of length then it will return the
12+
// data other wise return null right?
1213
item = item.next; // O(1)
13-
1414
}
1515
return item.data; // O(1)
1616
} // Algorithmic Complexity = O(n)
@@ -19,7 +19,7 @@ public static void set(LinkedList list, int index, int value) {
1919
LinkedList.Node item = list.head; // O(1)
2020
int length = list.length();
2121
for (int i = 0; i < length; i++) { // O(n)
22-
if(i==index){
22+
if (i == index) {
2323
item.data = value;
2424
}
2525
item = item.next; // O(1)

0 commit comments

Comments
 (0)