Skip to content

Commit c948124

Browse files
committed
add description
1 parent 5918b6c commit c948124

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Linked List/linked_list_even_or_odd.go

+7
Original file line numberDiff line numberDiff line change
@@ -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+
*/
18
package main
29
import "fmt"
310

0 commit comments

Comments
 (0)