The principle data structure java

 List

节点 Node up; Node down; Object o ;

 

属性Node first; Node last; int size;

 

方法 add(Object o); remove(int index); get(int index); getNode(int index); isEmpty();

set(int index,Object o);

 

 

 

 

Stack order

Properties: Object [] Data; Top = -1; max;

 

方法:init(int max); push(); pop(); peer(); getSize(); isEmpty(); isFull();

 

 

 

queue:

Front-> always refers to the first element

Rear-> refers to an element of the last element

 

属性:Object[] data; front=0; rear=0; max;

 

方法:init(int max); isEmpty(); isFull(); rudui(Object o); chudui(); getSize();

 

 

 

Circular queue, a circular queue space must loss

Enqueue rear = (rear + 1)% max dequeue front = (front + 1)% max team full (rear + 1)% max == front team empty rear == front

 

 

 

tree:

Binary Tree

Binary sort tree root :( maximum, minimum left node, right node)

节点Node: Node leftChild; Node rightChild(); int value;

 

Properties: the Node root;

 

方法:insert(); clear(); beforeOrder(); inOrder(); afterOrder(); getHeight(); getNodes(); isEmpty();

 

Guess you like

Origin www.cnblogs.com/ttaall/p/12001198.html
Recommended