| 114 | } |
| 115 | |
| 116 | public static void smokeTest(){ |
| 117 | System.out.print("Peek none: "); |
| 118 | System.out.println(peek(db)); |
| 119 | |
| 120 | push(db, "a", 1); |
| 121 | push(db, "b", 5); |
| 122 | push(db, "c", 2); |
| 123 | push(db, "d", 4); |
| 124 | push(db, "e", 3); |
| 125 | |
| 126 | System.out.println("Peek in min order."); |
| 127 | System.out.println(peek(db)); |
| 128 | System.out.println(peek(db)); |
| 129 | |
| 130 | System.out.println("Pop in min order."); |
| 131 | for(int i = 0; i < 5; i++) System.out.println(pop(db)); |
| 132 | |
| 133 | System.out.print("Peek none: "); |
| 134 | System.out.println(peek(db,true)); |
| 135 | |
| 136 | push(db, "a1", 1); |
| 137 | push(db, "a2", 1); |
| 138 | push(db, "a3", 1); |
| 139 | push(db, "a4", 1); |
| 140 | push(db, "b", 5); |
| 141 | push(db, "c", 2); |
| 142 | push(db, "d", 4); |
| 143 | push(db, "e", 3); |
| 144 | |
| 145 | System.out.println("Peek in max order."); |
| 146 | System.out.println(peek(db, true)); |
| 147 | System.out.println(peek(db, true)); |
| 148 | |
| 149 | System.out.println("Pop in max order."); |
| 150 | for(int i = 0; i < 9; i++) System.out.println(pop(db, true)); |
| 151 | } |
| 152 | |
| 153 | public static void main(String[] args){ |
| 154 | clearSubspace(db, pq); |