Documentation ¶
Index ¶
- type MyCircularDeque
- func (d *MyCircularDeque) DeleteFront() bool
- func (d *MyCircularDeque) DeleteLast() bool
- func (d *MyCircularDeque) GetFront() int
- func (d *MyCircularDeque) GetRear() int
- func (d *MyCircularDeque) InsertFront(value int) bool
- func (d *MyCircularDeque) InsertLast(value int) bool
- func (d *MyCircularDeque) IsEmpty() bool
- func (d *MyCircularDeque) IsFull() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MyCircularDeque ¶
type MyCircularDeque struct {
// contains filtered or unexported fields
}
MyCircularDeque 结构体
func Constructor ¶
func Constructor(k int) MyCircularDeque
Constructor initialize your data structure here. Set the size of the deque to be k.
func (*MyCircularDeque) DeleteFront ¶
func (d *MyCircularDeque) DeleteFront() bool
DeleteFront deletes an item from the front of Deque. Return true if the operation is successful.
func (*MyCircularDeque) DeleteLast ¶
func (d *MyCircularDeque) DeleteLast() bool
DeleteLast deletes an item from the rear of Deque. Return true if the operation is successful.
func (*MyCircularDeque) GetFront ¶
func (d *MyCircularDeque) GetFront() int
GetFront get the front item from the deque.
func (*MyCircularDeque) GetRear ¶
func (d *MyCircularDeque) GetRear() int
GetRear get the last item from the deque.
func (*MyCircularDeque) InsertFront ¶
func (d *MyCircularDeque) InsertFront(value int) bool
InsertFront adds an item at the front of Deque. Return true if the operation is successful.
func (*MyCircularDeque) InsertLast ¶
func (d *MyCircularDeque) InsertLast(value int) bool
InsertLast adds an item at the rear of Deque. Return true if the operation is successful.
func (*MyCircularDeque) IsEmpty ¶
func (d *MyCircularDeque) IsEmpty() bool
IsEmpty checks whether the circular deque is empty or not.
func (*MyCircularDeque) IsFull ¶
func (d *MyCircularDeque) IsFull() bool
IsFull checks whether the circular deque is full or not.