Knowledge stacks and queues

* Stacks and queues are two special linear form:
      having a logical relationship between the order of the data elements thereof, can be stored in sequential storage structure and chain structure
      insertion and deletion of linear form is not limited, it may be any position again perform
      insertion and deletion stack only allowed at one end of the table
      queue insertion and deletion operations were performed at both ends of the table.
* Stack characterized LIFO (LIFO), the characteristics of the FIFO queue (FIFO)

Queue (Queue) is a first-type set of reference objects.
Queue is a reference type object
Enqueue: enqueuing means, add data to a queue
Dequeue: dequeuing means, the data queue is pulled out
stack is a "last out" linear configuration
during insertion into data elements stack called stack (push)
process to remove elements from the stack is referred to (POP)
the Count: Get the number of elements contained in the Queue
the Clear (); removing all the elements from the Queue
Contains (object obj): determine whether an element is in the Queue
Dequeue (): Removes and returns the object at the beginning of the Queue
Enqueue (object obj): Adds an object to the end of Queue
ToArray (): Copy Queue to a new array
TrimToSize (): Set the number of elements in the actual capacity of Queue

 

Guess you like

Origin www.cnblogs.com/bly319/p/11166159.html