Documentation ¶
Index ¶
- type ArrayQueue
- func (arrayQueue *ArrayQueue) Capacity() int
- func (arrayQueue *ArrayQueue) Dequeue() interface{}
- func (arrayQueue *ArrayQueue) Enqueue(e interface{})
- func (arrayQueue *ArrayQueue) Front() interface{}
- func (arrayQueue *ArrayQueue) IsEmpty() bool
- func (arrayQueue *ArrayQueue) Size() int
- func (arrayQueue *ArrayQueue) String() string
- type IQueue
- type LinkedListQueue
- func (linkedListQueue *LinkedListQueue) Dequeue() interface{}
- func (linkedListQueue *LinkedListQueue) Enqueue(e interface{})
- func (linkedListQueue *LinkedListQueue) Front() interface{}
- func (linkedListQueue *LinkedListQueue) IsEmpty() bool
- func (linkedListQueue *LinkedListQueue) Size() int
- func (linkedListQueue *LinkedListQueue) String() string
- type LoopQueue
- func (loopQueue *LoopQueue) Capacity() int
- func (loopQueue *LoopQueue) Dequeue() (e interface{})
- func (loopQueue *LoopQueue) Enqueue(e interface{})
- func (loopQueue *LoopQueue) Front() interface{}
- func (loopQueue *LoopQueue) IsEmpty() bool
- func (loopQueue *LoopQueue) Size() int
- func (loopQueue *LoopQueue) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArrayQueue ¶
type ArrayQueue struct {
// contains filtered or unexported fields
}
数组队列的局限性:出队列的操作时间复杂度为 n
func NewArrayQueue ¶
func NewArrayQueue(capacity int) *ArrayQueue
func (*ArrayQueue) Capacity ¶
func (arrayQueue *ArrayQueue) Capacity() int
func (*ArrayQueue) Dequeue ¶
func (arrayQueue *ArrayQueue) Dequeue() interface{}
func (*ArrayQueue) Enqueue ¶
func (arrayQueue *ArrayQueue) Enqueue(e interface{})
func (*ArrayQueue) Front ¶
func (arrayQueue *ArrayQueue) Front() interface{}
func (*ArrayQueue) IsEmpty ¶
func (arrayQueue *ArrayQueue) IsEmpty() bool
func (*ArrayQueue) Size ¶
func (arrayQueue *ArrayQueue) Size() int
func (*ArrayQueue) String ¶
func (arrayQueue *ArrayQueue) String() string
type IQueue ¶
type IQueue interface { Size() int IsEmpty() bool Enqueue(interface{}) Dequeue() interface{} Front() interface{} }
Queue 先进先出
type LinkedListQueue ¶
type LinkedListQueue struct {
// contains filtered or unexported fields
}
func NewLinkedListQueue ¶
func NewLinkedListQueue() *LinkedListQueue
func (*LinkedListQueue) Dequeue ¶
func (linkedListQueue *LinkedListQueue) Dequeue() interface{}
func (*LinkedListQueue) Enqueue ¶
func (linkedListQueue *LinkedListQueue) Enqueue(e interface{})
func (*LinkedListQueue) Front ¶
func (linkedListQueue *LinkedListQueue) Front() interface{}
func (*LinkedListQueue) IsEmpty ¶
func (linkedListQueue *LinkedListQueue) IsEmpty() bool
func (*LinkedListQueue) Size ¶
func (linkedListQueue *LinkedListQueue) Size() int
func (*LinkedListQueue) String ¶
func (linkedListQueue *LinkedListQueue) String() string
type LoopQueue ¶
type LoopQueue struct {
// contains filtered or unexported fields
}
LoopQueue 循环队列
func NewLoopQueue ¶
Click to show internal directories.
Click to hide internal directories.