mirror of
https://github.com/golang/go.git
synced 2025-05-05 15:43:04 +00:00
"Pop" in Stack/LIFO supposed to be opposite of "Push", not of "Push Front".
parent
432d6fff8e
commit
f1e07061fb
@ -86,12 +86,12 @@ s[i] = x
|
||||
a = append(a[:i], append(b, a[i:]...)...)
|
||||
```
|
||||
|
||||
#### Pop/Shift
|
||||
#### Pop Front/Shift
|
||||
```go
|
||||
x, a = a[0], a[1:]
|
||||
```
|
||||
|
||||
#### Pop Back
|
||||
#### Pop
|
||||
```go
|
||||
x, a = a[len(a)-1], a[:len(a)-1]
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user