forked from crossoverJie/JCSprout
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTwoStackQueueTest.java
More file actions
36 lines (26 loc) · 955 Bytes
/
TwoStackQueueTest.java
File metadata and controls
36 lines (26 loc) · 955 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package com.crossoverjie.algorithm;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class TwoStackQueueTest {
private final static Logger LOGGER = LoggerFactory.getLogger(TwoStackQueueTest.class);
@Test
public void queue(){
TwoStackQueue<String> twoStackQueue = new TwoStackQueue<String>() ;
twoStackQueue.appendTail("1") ;
twoStackQueue.appendTail("2") ;
twoStackQueue.appendTail("3") ;
twoStackQueue.appendTail("4") ;
twoStackQueue.appendTail("5") ;
int size = twoStackQueue.getSize();
for (int i = 0; i< size ; i++){
LOGGER.info(twoStackQueue.deleteHead());
}
LOGGER.info("========第二次添加=========");
twoStackQueue.appendTail("6") ;
size = twoStackQueue.getSize();
for (int i = 0; i< size ; i++){
LOGGER.info(twoStackQueue.deleteHead());
}
}
}