Skip to content

Commit 2175d94

Browse files
Merge pull request kunal-kushwaha#502 from aniketwdubey/main
Updated LL.java
2 parents 5ecdbaf + 8a78540 commit 2175d94

File tree

1 file changed

+2
-1
lines changed
  • lectures/18-linkedlist/code/src/com/kunal

1 file changed

+2
-1
lines changed

lectures/18-linkedlist/code/src/com/kunal/LL.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ public int deleteLast() {
7878
int val = tail.value;
7979
tail = secondLast;
8080
tail.next = null;
81+
size--;
8182
return val;
8283
}
8384

@@ -93,7 +94,7 @@ public int delete(int index) {
9394
int val = prev.next.value;
9495

9596
prev.next = prev.next.next;
96-
97+
size--;
9798
return val;
9899
}
99100

0 commit comments

Comments
 (0)