File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
src/main/java/com/fishercoder/common/utils Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 4
4
import com .fishercoder .common .classes .ListNode ;
5
5
6
6
import java .util .ArrayList ;
7
+ import java .util .Deque ;
7
8
import java .util .List ;
8
9
import java .util .Random ;
9
10
@@ -172,6 +173,20 @@ public static <T> void printList(List<T> list) {
172
173
System .out .println ();
173
174
}
174
175
176
+ public static <T > void printDeque (Deque <T > deque ) {
177
+ int count = 0 ;
178
+ for (T t : deque ) {
179
+ count ++;
180
+ System .out .print (t );
181
+ if (count % 10 != 0 ) {
182
+ System .out .print ("\t " );
183
+ } else {
184
+ System .out .println ();
185
+ }
186
+ }
187
+ System .out .println ();
188
+ }
189
+
175
190
public static void printMatrix (int [][] matrix ) {
176
191
System .out .println ("Matrix is: " );
177
192
for (int i = 0 ; i < matrix .length ; i ++) {
You can’t perform that action at this time.
0 commit comments