/**
* Definition for singly-linked list.
* type ListNode struct {
* Val int
* Next *ListNode
* }
*/
func middleNode(head *ListNode) *ListNode {
var elements []int
t_head := head
for ;t_head!=nil; {
elements = append(elements, t_head.Val)
t_head = t_head.Next
}
mid := len(elements)/2
for range mid {
head = head.Next
}
return head
}