leetcode-go/src/node.go

16 lines
202 B
Go

package src
import "fmt"
type Node struct {
Value int
Next *Node
}
func (n *Node) String() string {
if n == nil {
return "nil"
}
return fmt.Sprintf("{Value:%d Next:%+v}", n.Value, *n.Next)
}