You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
estlop 2e97385c73 docs: Correct instructions about what to return 2 years ago
..
README.md docs: Correct instructions about what to return 2 years ago

README.md

listlast

Instructions

Write a function ListLast that returns the Data interface of the last element of a linked list l.

Expected function and structure

type NodeL struct {
	Data interface{}
	Next *NodeL
}

type List struct {
	Head *NodeL
	Tail *NodeL
}

func ListLast(l *List) interface{} {

}

Usage

Here is a possible program to test your function :

package main

import (
	"fmt"

	"piscine"
)

func main() {
	link := &piscine.List{}
	link2 := &piscine.List{}

	piscine.ListPushBack(link, "three")
	piscine.ListPushBack(link, 3)
	piscine.ListPushBack(link, "1")

	fmt.Println(piscine.ListLast(link))
	fmt.Println(piscine.ListLast(link2))
}

And its output :

$ go run .
1
<nil>
$