go20/day02/slice/append.drawio

128 lines
9.4 KiB
Plaintext
Raw Permalink Normal View History

<mxfile host="65bd71144e">
<diagram id="g4mhtEkjE2LYKTrqnUZr" name="第 1 页">
<mxGraphModel dx="1134" dy="414" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="2" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="90" y="160" width="370" height="80" as="geometry"/>
</mxCell>
<mxCell id="3" value="s1: []int{1,2,3}" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="90" y="130" width="110" height="30" as="geometry"/>
</mxCell>
<mxCell id="4" value="arry ptr" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="120" y="185" width="90" height="30" as="geometry"/>
</mxCell>
<mxCell id="5" value="len(3)" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="230" y="185" width="90" height="30" as="geometry"/>
</mxCell>
<mxCell id="6" value="cap(3)" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="350" y="185" width="90" height="30" as="geometry"/>
</mxCell>
<mxCell id="7" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="90" y="300" width="370" height="60" as="geometry"/>
</mxCell>
<mxCell id="8" style="edgeStyle=none;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.203;entryY=0.017;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1" source="4" target="7">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="9" value="1" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="120" y="310" width="80" height="40" as="geometry"/>
</mxCell>
<mxCell id="10" value="2" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="230" y="310" width="80" height="40" as="geometry"/>
</mxCell>
<mxCell id="11" value="3" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="334" y="310" width="80" height="40" as="geometry"/>
</mxCell>
<mxCell id="12" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="90" y="430" width="370" height="80" as="geometry"/>
</mxCell>
<mxCell id="13" value="arry ptr" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="120" y="455" width="90" height="30" as="geometry"/>
</mxCell>
<mxCell id="14" value="len(4)" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="230" y="455" width="90" height="30" as="geometry"/>
</mxCell>
<mxCell id="15" value="cap(6)" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="350" y="455" width="90" height="30" as="geometry"/>
</mxCell>
<mxCell id="16" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="90" y="570" width="620" height="60" as="geometry"/>
</mxCell>
<mxCell id="17" style="edgeStyle=none;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="13">
<mxGeometry relative="1" as="geometry">
<mxPoint x="160" y="570" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="18" value="1" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="120" y="580" width="80" height="40" as="geometry"/>
</mxCell>
<mxCell id="19" value="2" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="220" y="580" width="80" height="40" as="geometry"/>
</mxCell>
<mxCell id="20" value="3" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="320" y="580" width="80" height="40" as="geometry"/>
</mxCell>
<mxCell id="21" value="s1_v1:= append(s1, 4)" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="90" y="400" width="140" height="30" as="geometry"/>
</mxCell>
<mxCell id="22" value="arr1: [3]int" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="90" y="270" width="60" height="30" as="geometry"/>
</mxCell>
<mxCell id="23" value="4" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="414" y="580" width="80" height="40" as="geometry"/>
</mxCell>
<mxCell id="27" value="arr2: [6]int" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="90" y="540" width="60" height="30" as="geometry"/>
</mxCell>
<mxCell id="28" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="90" y="710" width="370" height="80" as="geometry"/>
</mxCell>
<mxCell id="29" value="arry ptr" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="120" y="735" width="90" height="30" as="geometry"/>
</mxCell>
<mxCell id="30" value="len(5)" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="230" y="735" width="90" height="30" as="geometry"/>
</mxCell>
<mxCell id="31" value="cap(6)" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="350" y="735" width="90" height="30" as="geometry"/>
</mxCell>
<mxCell id="32" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="90" y="850" width="620" height="60" as="geometry"/>
</mxCell>
<mxCell id="33" style="edgeStyle=none;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="29">
<mxGeometry relative="1" as="geometry">
<mxPoint x="160" y="850" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="34" value="1" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="120" y="860" width="80" height="40" as="geometry"/>
</mxCell>
<mxCell id="35" value="2" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="220" y="860" width="80" height="40" as="geometry"/>
</mxCell>
<mxCell id="36" value="3" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="320" y="860" width="80" height="40" as="geometry"/>
</mxCell>
<mxCell id="37" value="s1_v2:= append(s1, 5)" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="90" y="680" width="140" height="30" as="geometry"/>
</mxCell>
<mxCell id="38" value="4" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="414" y="860" width="80" height="40" as="geometry"/>
</mxCell>
<mxCell id="39" value="arr2: [6]int" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="90" y="820" width="60" height="30" as="geometry"/>
</mxCell>
<mxCell id="40" value="5" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="520" y="860" width="80" height="40" as="geometry"/>
</mxCell>
<mxCell id="41" value="容量不够,底层数组扩容,重新申请内存" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="240" y="400" width="230" height="30" as="geometry"/>
</mxCell>
<mxCell id="42" value="容量够,继续使用底层数组进行数据存储" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="240" y="680" width="230" height="30" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>