Skip to content

Commit bce4a01

Browse files
committed
New Problems
New Problems
1 parent 4bb58f7 commit bce4a01

File tree

5 files changed

+4
-4
lines changed

5 files changed

+4
-4
lines changed
351 Bytes
Binary file not shown.
454 Bytes
Binary file not shown.
246 Bytes
Binary file not shown.

bin/chapter06trees/CheckAVL.class

387 Bytes
Binary file not shown.

src/chapter03linkedlists/NthNodeFromEnd.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,19 @@ public static ListNode nthNodeFromEndIterative(ListNode head, int Nth) {
2929
if(head == null){
3030
return null;
3131
}
32-
ListNode n = head;
32+
ListNode nth = head;
3333
// Get nth from the start
3434
for (int i = 0; i < Nth; i++) {
3535
if(nth.next == null){
3636
return null;
3737
}
38-
n = n.next;
38+
nth = nth.next;
3939
}
4040
// Move both the head and nth node so the difference between them is n
4141
// Thus we get the nth node from the end
42-
while(n != null){
42+
while(nth != null){
4343
head = head.next;
44-
n = n.next;
44+
nth = nth.next;
4545
}
4646
return head;
4747
}

0 commit comments

Comments
 (0)