Skip to content

Commit 9b4a2c6

Browse files
authored
Update GetNodeValule.java
1 parent 624bda5 commit 9b4a2c6

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

LinkedList/GetNodeValule.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
Get Node Value
33
4-
You’re given the pointer to the head node of a linked list and a specific position.
4+
You’re given the pointer to the head node of a linked list and a specific position.
55
Counting backwards from the tail node of the linked list, get the value of the node at the given position.
66
A position of 0 corresponds to the tail, 1 corresponds to the node before the tail and so on.
77
@@ -17,9 +17,7 @@ class Node {
1717
*/
1818

1919
int GetNode(Node head,int n) {
20-
// This is a "method-only" submission.
21-
// You only need to complete this method.
22-
20+
2321
Node prev=head,ahead=head;
2422

2523
for(int i=1;i<=n;i++)

0 commit comments

Comments
 (0)