func (l DoublyLinkedList) ToArray() []int {
	arr := make([]int, 0)

	tmp := l.Head
	for tmp != nil {
		arr = append(arr, tmp.value)
		tmp = tmp.right
	}

	return arr
}
// ToArray converts linked list to an array
ToArray converts linked list to an array
// ToArray converts linked list to an array
func (l DoublyLinkedList) ToArray() []int {
	arr := make([]int, 0)
	tmp := l.Head
	for tmp != nil {
		arr = append(arr, tmp.value)
		tmp = tmp.right
	}
	return arr
}
func ( l DoublyLinkedList ) ToArray ( ) [ ] int { arr := make ( [ ] int , 0 ) tmp := l . Head for tmp != nil { arr = append ( arr , tmp . value ) tmp = tmp . right } return arr }
ToArray converts linked list to an array
ToArray converts linked list to an array