leetcode-go/src/node.go

16 lines
202 B
Go
Raw Normal View History

2022-05-22 15:54:36 +00:00
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)
}