We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 624bda5 commit 9b4a2c6Copy full SHA for 9b4a2c6
LinkedList/GetNodeValule.java
@@ -1,7 +1,7 @@
1
/*
2
Get Node Value
3
4
-You’re given the pointer to the head node of a linked list and a specific position.
+You’re given the pointer to the head node of a linked list and a specific position.
5
Counting backwards from the tail node of the linked list, get the value of the node at the given position.
6
A position of 0 corresponds to the tail, 1 corresponds to the node before the tail and so on.
7
@@ -17,9 +17,7 @@ class Node {
17
*/
18
19
int GetNode(Node head,int n) {
20
- // This is a "method-only" submission.
21
- // You only need to complete this method.
22
-
+
23
Node prev=head,ahead=head;
24
25
for(int i=1;i<=n;i++)
0 commit comments