From 5f44588a6ff9c7293b40d2dc0de1189b17b6ffeb Mon Sep 17 00:00:00 2001 From: OGordoo Date: Thu, 5 Dec 2019 14:15:27 +0000 Subject: [PATCH] Node to NodeAddL --- subjects/addlinkednumbers.en.md | 14 +++++++------- subjects/changeorder.en.md | 8 ++++---- subjects/reverse.en.md | 10 +++++----- subjects/sortll.en.md | 8 ++++---- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/subjects/addlinkednumbers.en.md b/subjects/addlinkednumbers.en.md index e606e75ba..1daf1d0ae 100644 --- a/subjects/addlinkednumbers.en.md +++ b/subjects/addlinkednumbers.en.md @@ -13,7 +13,7 @@ This means that: ### Instructions -You have two numbers represented by a linked list, where each node contains a single digit. +You have two numbers represented by a linked list, where each NodeAddL contains a single digit. The digits are stored in reverse order, such that the 1’s digit is at the head of the list. Write a function that adds the two numbers and returns the sum as a linked list @@ -22,12 +22,12 @@ Write a function that adds the two numbers and returns the sum as a linked list ```go package main -type Node struct { - Next *Node +type NodeAddL struct { + Next *NodeAddL Num int } -func AddLinkedNumbers(num1, num1 *Node) *Node { +func AddLinkedNumbers(num1, num1 *NodeAddL) *NodeAddL { } ``` @@ -43,19 +43,19 @@ import ( "fmt" ) -func pushFront(node *Node, num int) *Node { +func pushFront(node *NodeAddL, num int) *NodeAddL { // ... // Write yourself } func main() { // 3 -> 1 -> 5 - num1 := &Node{Num:5} + num1 := &NodeAddL{Num:5} num1 = pushFront(num1, 1) num1 = pushFront(num1, 3) // 5 -> 9 -> 2 - num2 := &Node{Num:2} + num2 := &NodeAddL{Num:2} num2 = pushFront(num2, 9) num2 = pushFront(num2, 5) diff --git a/subjects/changeorder.en.md b/subjects/changeorder.en.md index 59d97e12a..6a4816c4e 100644 --- a/subjects/changeorder.en.md +++ b/subjects/changeorder.en.md @@ -23,12 +23,12 @@ You have to return pointer/reference to the beginning of new list ```go package main -type Node struct { - Next *Node +type NodeAddL struct { + Next *NodeAddL Num int } -func Changeorder(node *Node) *Node { +func Changeorder(node *NodeAddL) *NodeAddL { } ``` @@ -47,7 +47,7 @@ import ( // I implemented pushBack for this func main() { - num1 := &Node{Num: 1} + num1 := &NodeAddL{Num: 1} num1 = pushBack(num1, 2) num1 = pushBack(num1, 3) num1 = pushBack(num1, 4) diff --git a/subjects/reverse.en.md b/subjects/reverse.en.md index 2f357c256..9535f5f3a 100644 --- a/subjects/reverse.en.md +++ b/subjects/reverse.en.md @@ -21,12 +21,12 @@ Write a function that reverses the list and returns pointer/reference to new lin ```go package main -type Node struct { - Next *Node +type NodeAddL struct { + Next *NodeAddL Num int } -func Reverse(node *Node) *Node { +func Reverse(node *NodeAddL) *NodeAddL { } ``` @@ -42,12 +42,12 @@ import ( "fmt" ) -func pushBack(n *Node, num int) *Node{ +func pushBack(n *NodeAddL, num int) *NodeAddL{ } func main() { - num1 := &piscine.Node{Num: 1} + num1 := &piscine.NodeAddL{Num: 1} num1 = pushBack(num1, 3) num1 = pushBack(num1, 2) num1 = pushBack(num1, 4) diff --git a/subjects/sortll.en.md b/subjects/sortll.en.md index 8efa5e723..42f96dbaf 100644 --- a/subjects/sortll.en.md +++ b/subjects/sortll.en.md @@ -21,12 +21,12 @@ Write a function that sorts the list in descending order and return pointer/refe ```go package piscine -type Node struct { - Next *Node +type NodeAddL struct { + Next *NodeAddL Num int } -func Sortll(node *Node) *Node { +func Sortll(node *NodeAddL) *NodeAddL { } ``` @@ -45,7 +45,7 @@ import ( // I implemented pushBack for this func main() { - num1 := &piscine.Node{Num: 5} + num1 := &piscine.NodeAddL{Num: 5} num1 = pushBack(num1, 1) num1 = pushBack(num1, 3) num1 = pushBack(num1, 1)