27.10.2014 Views

Cracking the Coding Interview, 4 Edition - 150 Programming Interview Questions and Solutions

Cracking the Coding Interview, 4 Edition - 150 Programming Interview Questions and Solutions

Cracking the Coding Interview, 4 Edition - 150 Programming Interview Questions and Solutions

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Solutions</strong> to Chapter 7 | Object Oriented Design<br />

41 }<br />

42 }<br />

Overview:<br />

1. We grouped <strong>the</strong> edges by <strong>the</strong>ir type. Because inners go with outers, <strong>and</strong> vice versa,<br />

this enables us to go straight to <strong>the</strong> potential matches.<br />

We keep track of <strong>the</strong> inner perimeter of <strong>the</strong> puzzle (exposed_edges) as we work our<br />

way inwards. exposed_edges is initialized to be <strong>the</strong> corner’s edges.<br />

CareerCup.com<br />

1 6 0

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!