标签: double doubly-linked-list
该算法最差运行情况时间的评估
Node temp=head; //swap head and tail head=tail; // head now points to tail tail=temp; Node p=head; //create a node and point to head while(p!=null) { temp=p.next; p.next=p.prev; p.prev=temp; p=p.next; }