Skip to content

Commit

Permalink
Add slice DeQueue (#31)
Browse files Browse the repository at this point in the history
* Add slice DeQueue

* Update slice DeQueue
  • Loading branch information
Chen Quan committed Mar 6, 2021
1 parent bff2a19 commit d0f70ed
Show file tree
Hide file tree
Showing 4 changed files with 454 additions and 5 deletions.
4 changes: 2 additions & 2 deletions backend/collection/deque.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

package collection

// DeQue 双端队列
type DeQue interface {
// DeQueue 双端队列
type DeQueue interface {
// 实现队列接口
Queue
AddFirst(e Element) error
Expand Down
8 changes: 5 additions & 3 deletions errs/err.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ import "errors"

var (
//NotFound = errors.New("not found")
IndexOutOfBound = errors.New("index out of bound")
NoSuchElement = errors.New("no such element")
IllegalState = errors.New("illegal state")
IndexOutOfBound = errors.New("index out of bound")
NoSuchElement = errors.New("no such element")
IllegalState = errors.New("illegal state")
NilPointer = errors.New("nil pointer")
ConcurrentModification = errors.New("concurrent Modification")
)

// indexOutOfBoundsException 实现 errs 接口
Expand Down
Loading

0 comments on commit d0f70ed

Please sign in to comment.