We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5918b6c commit c948124Copy full SHA for c948124
Linked List/linked_list_even_or_odd.go
@@ -1,3 +1,10 @@
1
+/*
2
+ Check whether the given Linked List length is even or odd?
3
+
4
+ Approach:
5
+ Use a 2x pointer. Take a pointer that moves at 2x [two nodes at a time]. At the end, if the length is even,
6
+ then the pointer will be nil; otherwise it will point to the last node.
7
+*/
8
package main
9
import "fmt"
10
0 commit comments