109 lines
5.8 KiB
Text
109 lines
5.8 KiB
Text
|
|
<mxfile host="draw.io">
|
||
|
|
<diagram id="dictionary_lookup" name="Ch3 Ex7 - Looking Up a Word in the Dictionary">
|
||
|
|
<mxGraphModel dx="1422" dy="762" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="827" math="0" shadow="0">
|
||
|
|
<root>
|
||
|
|
<mxCell id="0" />
|
||
|
|
<mxCell id="1" parent="0" />
|
||
|
|
|
||
|
|
<!-- TITLE -->
|
||
|
|
<mxCell id="100" value="Ch. 3, Exercise 7 — Looking Up a Word in the Dictionary
Programmer: Rosie Val" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=13;fontStyle=1;" vertex="1" parent="1">
|
||
|
|
<mxGeometry x="170" y="690" width="500" height="50" as="geometry" />
|
||
|
|
</mxCell>
|
||
|
|
|
||
|
|
<!-- START -->
|
||
|
|
<mxCell id="2" value="Start" style="ellipse;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontStyle=1;fontSize=11;" vertex="1" parent="1">
|
||
|
|
<mxGeometry x="330" y="20" width="140" height="40" as="geometry" />
|
||
|
|
</mxCell>
|
||
|
|
|
||
|
|
<!-- I/O: Input word to find -->
|
||
|
|
<mxCell id="3" value="Input: word to look up" style="shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;size=15;" vertex="1" parent="1">
|
||
|
|
<mxGeometry x="275" y="100" width="250" height="50" as="geometry" />
|
||
|
|
</mxCell>
|
||
|
|
|
||
|
|
<!-- PROCESS: Open to middle page -->
|
||
|
|
<mxCell id="4" value="Open dictionary to the middle page" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||
|
|
<mxGeometry x="275" y="190" width="250" height="50" as="geometry" />
|
||
|
|
</mxCell>
|
||
|
|
|
||
|
|
<!-- DECISION 1: Is word on this page? -->
|
||
|
|
<mxCell id="5" value="Is the word on
this page?" style="rhombus;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||
|
|
<mxGeometry x="320" y="280" width="160" height="80" as="geometry" />
|
||
|
|
</mxCell>
|
||
|
|
|
||
|
|
<!-- I/O: Word found -->
|
||
|
|
<mxCell id="6" value='Output: "Word found!"' style="shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;size=15;" vertex="1" parent="1">
|
||
|
|
<mxGeometry x="600" y="295" width="210" height="50" as="geometry" />
|
||
|
|
</mxCell>
|
||
|
|
|
||
|
|
<!-- STOP -->
|
||
|
|
<mxCell id="7" value="Stop" style="ellipse;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontStyle=1;fontSize=11;" vertex="1" parent="1">
|
||
|
|
<mxGeometry x="645" y="375" width="140" height="40" as="geometry" />
|
||
|
|
</mxCell>
|
||
|
|
|
||
|
|
<!-- DECISION 2: Word before this page? -->
|
||
|
|
<mxCell id="8" value="Does the word come
BEFORE words on
this page
(alphabetically)?" style="rhombus;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||
|
|
<mxGeometry x="295" y="400" width="210" height="110" as="geometry" />
|
||
|
|
</mxCell>
|
||
|
|
|
||
|
|
<!-- PROCESS: Open to middle of first half -->
|
||
|
|
<mxCell id="9" value="Open to the middle
of the FIRST half" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||
|
|
<mxGeometry x="20" y="545" width="240" height="60" as="geometry" />
|
||
|
|
</mxCell>
|
||
|
|
|
||
|
|
<!-- PROCESS: Open to middle of second half -->
|
||
|
|
<mxCell id="10" value="Open to the middle
of the SECOND half" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||
|
|
<mxGeometry x="555" y="545" width="255" height="60" as="geometry" />
|
||
|
|
</mxCell>
|
||
|
|
|
||
|
|
<!-- EDGES -->
|
||
|
|
<mxCell id="20" style="edgeStyle=orthogonalEdgeStyle;html=1;" edge="1" source="2" target="3" parent="1">
|
||
|
|
<mxGeometry relative="1" as="geometry" />
|
||
|
|
</mxCell>
|
||
|
|
<mxCell id="21" style="edgeStyle=orthogonalEdgeStyle;html=1;" edge="1" source="3" target="4" parent="1">
|
||
|
|
<mxGeometry relative="1" as="geometry" />
|
||
|
|
</mxCell>
|
||
|
|
<mxCell id="22" style="edgeStyle=orthogonalEdgeStyle;html=1;" edge="1" source="4" target="5" parent="1">
|
||
|
|
<mxGeometry relative="1" as="geometry" />
|
||
|
|
</mxCell>
|
||
|
|
<!-- Decision 1: Yes → Word found -->
|
||
|
|
<mxCell id="23" value="Yes" style="edgeStyle=orthogonalEdgeStyle;html=1;" edge="1" source="5" target="6" parent="1">
|
||
|
|
<mxGeometry relative="1" as="geometry" />
|
||
|
|
</mxCell>
|
||
|
|
<!-- Word found → Stop -->
|
||
|
|
<mxCell id="24" style="edgeStyle=orthogonalEdgeStyle;html=1;" edge="1" source="6" target="7" parent="1">
|
||
|
|
<mxGeometry relative="1" as="geometry" />
|
||
|
|
</mxCell>
|
||
|
|
<!-- Decision 1: No → Decision 2 -->
|
||
|
|
<mxCell id="25" value="No" style="edgeStyle=orthogonalEdgeStyle;html=1;" edge="1" source="5" target="8" parent="1">
|
||
|
|
<mxGeometry relative="1" as="geometry" />
|
||
|
|
</mxCell>
|
||
|
|
<!-- Decision 2: Yes → First half -->
|
||
|
|
<mxCell id="26" value="Yes" style="edgeStyle=orthogonalEdgeStyle;html=1;" edge="1" source="8" target="9" parent="1">
|
||
|
|
<mxGeometry relative="1" as="geometry" />
|
||
|
|
</mxCell>
|
||
|
|
<!-- Decision 2: No → Second half -->
|
||
|
|
<mxCell id="27" value="No" style="edgeStyle=orthogonalEdgeStyle;html=1;" edge="1" source="8" target="10" parent="1">
|
||
|
|
<mxGeometry relative="1" as="geometry" />
|
||
|
|
</mxCell>
|
||
|
|
<!-- First half → Decision 1 (loop back, left side) -->
|
||
|
|
<mxCell id="28" style="edgeStyle=orthogonalEdgeStyle;html=1;" edge="1" source="9" target="5" parent="1">
|
||
|
|
<mxGeometry relative="1" as="geometry">
|
||
|
|
<Array as="points">
|
||
|
|
<mxPoint x="5" y="260" />
|
||
|
|
</Array>
|
||
|
|
</mxGeometry>
|
||
|
|
</mxCell>
|
||
|
|
<!-- Second half → Decision 1 (loop back, right side) -->
|
||
|
|
<mxCell id="29" style="edgeStyle=orthogonalEdgeStyle;html=1;" edge="1" source="10" target="5" parent="1">
|
||
|
|
<mxGeometry relative="1" as="geometry">
|
||
|
|
<Array as="points">
|
||
|
|
<mxPoint x="840" y="260" />
|
||
|
|
</Array>
|
||
|
|
</mxGeometry>
|
||
|
|
</mxCell>
|
||
|
|
|
||
|
|
</root>
|
||
|
|
</mxGraphModel>
|
||
|
|
</diagram>
|
||
|
|
</mxfile>
|