[fix] format fix for stack-1-introduction

master
Furkan Türkal 6 years ago
parent 56faa5361c
commit 284804d929
No known key found for this signature in database
GPG Key ID: 3015FE56155820F2

@ -49,7 +49,6 @@ func Push(stack *Stack, item int) {
}
stack.top++
stack.array[stack.top] = item
fmt.Println("Pushed to stack : %d", item)
}
func Pop(stack *Stack) int {
@ -66,9 +65,12 @@ func main() {
stack := New(100)
Push(stack, 10)
fmt.Println("Pushed to stack : 10")
Push(stack, 20)
fmt.Println("Pushed to stack : 20")
Push(stack, 30)
fmt.Println("Pushed to stack : 30")
fmt.Println("Popped from stack : %d", Pop(stack))
fmt.Printf("Popped from stack : %d", Pop(stack))
}

Loading…
Cancel
Save