MCPcopy Create free account
hub / github.com/careercup/ctci / print

Method print

java/Chapter 8/Question8_4/Level.java:79–89  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

77 }
78
79 public void print() {
80 int lastRow = -1;
81 for (int i = 0; i < spots.length; i++) {
82 ParkingSpot spot = spots[i];
83 if (spot.getRow() != lastRow) {
84 System.out.print(" ");
85 lastRow = spot.getRow();
86 }
87 spot.print();
88 }
89 }
90
91 /* When a car was removed from the spot, increment availableSpots */
92 public void spotFreed() {

Callers

nothing calls this directly

Calls 2

getRowMethod · 0.95
printMethod · 0.95

Tested by

no test coverage detected