mirror of
https://github.com/prdlk/leetcode.git
synced 2026-11-02 21:22:43 +00:00
77 lines
11 KiB
XML
77 lines
11 KiB
XML
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|||
|
|
<!-- Created with Pixodesk SVG (https://pixodesk.com) -->
|
||
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 900 400" text-rendering="geometricPrecision" shape-rendering="geometricPrecision">
|
||
|
|
<defs>
|
||
|
|
<marker id="arrowhead" refX="9" refY="3" markerHeight="10" markerWidth="10" orient="auto">
|
||
|
|
<path fill="#e74c3c" d="M0,0L10,3L0,6"/>
|
||
|
|
</marker>
|
||
|
|
</defs>
|
||
|
|
<rect fill="#f8f9fa" rx="10" ry="0" width="900" height="400"/>
|
||
|
|
<text fill="#2c3e50" text-anchor="middle" font-family="Arial, sans-serif" font-size="22" font-weight="700" xml:space="preserve" x="450" y="30" data-gn-el-type="text" style="white-space:pre"><tspan>Core Stack Operations</tspan></text>
|
||
|
|
<g id="push-operation">
|
||
|
|
<text fill="#27ae60" text-anchor="middle" font-family="Arial, sans-serif" font-size="16" font-weight="700" xml:space="preserve" x="90" y="75" data-gn-el-type="text" style="white-space:pre"><tspan>PUSH</tspan></text>
|
||
|
|
<text fill="#7f8c8d" font-family="Arial, sans-serif" font-size="12" xml:space="preserve" x="50" y="95" data-gn-el-type="text" style="white-space:pre"><tspan>Add to top</tspan></text>
|
||
|
|
<rect fill="#ffffff" stroke="#bdc3c7" stroke-width="2" rx="5" ry="0" x="40" y="110" width="100" height="200"/>
|
||
|
|
<rect fill="#3498db" stroke="#2980b9" stroke-width="2" rx="3" ry="0" x="50" y="280" width="80" height="25"/>
|
||
|
|
<text fill="#ffffff" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="700" xml:space="preserve" x="90" y="297" data-gn-el-type="text" style="white-space:pre"><tspan>10</tspan></text>
|
||
|
|
<rect fill="#3498db" stroke="#2980b9" stroke-width="2" rx="3" ry="0" x="50" y="250" width="80" height="25"/>
|
||
|
|
<text fill="#ffffff" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="700" xml:space="preserve" x="90" y="267" data-gn-el-type="text" style="white-space:pre"><tspan>20</tspan></text>
|
||
|
|
<rect fill="#27ae60" stroke="#229954" stroke-width="2" rx="3" ry="0" x="50" y="200" width="80" height="25"/>
|
||
|
|
<text fill="#ffffff" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="700" xml:space="preserve" x="90" y="217" data-gn-el-type="text" style="white-space:pre"><tspan>30</tspan></text>
|
||
|
|
<path fill="none" stroke="#27ae60" stroke-width="2" marker-end="url(#arrowhead)" d="M30,180L30,210"/>
|
||
|
|
<text fill="#27ae60" font-family="Arial, sans-serif" font-size="11" font-weight="700" xml:space="preserve" x="10" y="170" data-gn-el-type="text" style="white-space:pre"><tspan>New</tspan></text>
|
||
|
|
<text fill="#e74c3c" font-family="Arial, sans-serif" font-size="11" font-weight="700" xml:space="preserve" x="140" y="215" data-gn-el-type="text" style="white-space:pre"><tspan>← TOP</tspan></text>
|
||
|
|
</g>
|
||
|
|
<g id="pop-operation">
|
||
|
|
<text fill="#e74c3c" text-anchor="middle" font-family="Arial, sans-serif" font-size="16" font-weight="700" xml:space="preserve" x="270" y="75" data-gn-el-type="text" style="white-space:pre"><tspan>POP</tspan></text>
|
||
|
|
<text fill="#7f8c8d" font-family="Arial, sans-serif" font-size="12" xml:space="preserve" x="215" y="95" data-gn-el-type="text" style="white-space:pre"><tspan>Remove from top</tspan></text>
|
||
|
|
<rect fill="#ffffff" stroke="#bdc3c7" stroke-width="2" rx="5" ry="0" x="220" y="110" width="100" height="200"/>
|
||
|
|
<rect fill="#3498db" stroke="#2980b9" stroke-width="2" rx="3" ry="0" x="230" y="280" width="80" height="25"/>
|
||
|
|
<text fill="#ffffff" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="700" xml:space="preserve" x="270" y="297" data-gn-el-type="text" style="white-space:pre"><tspan>10</tspan></text>
|
||
|
|
<rect fill="#3498db" stroke="#2980b9" stroke-width="2" rx="3" ry="0" x="230" y="250" width="80" height="25"/>
|
||
|
|
<text fill="#ffffff" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="700" xml:space="preserve" x="270" y="267" data-gn-el-type="text" style="white-space:pre"><tspan>20</tspan></text>
|
||
|
|
<rect fill="#e74c3c" stroke="#c0392b" stroke-width="2" opacity="0.5" rx="3" ry="0" x="230" y="180" width="80" height="25"/>
|
||
|
|
<text fill="#ffffff" opacity="0.5" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="700" xml:space="preserve" x="270" y="197" data-gn-el-type="text" style="white-space:pre"><tspan>30</tspan></text>
|
||
|
|
<path fill="none" stroke="#e74c3c" stroke-width="2" marker-end="url(#arrowhead)" d="M330,185L360,150"/>
|
||
|
|
<text fill="#e74c3c" font-family="Arial, sans-serif" font-size="11" font-weight="700" xml:space="preserve" transform="translate(-3, 7)" x="365" y="145" data-gn-el-type="text" style="white-space:pre"><tspan>Removed</tspan></text>
|
||
|
|
<rect fill="#e74c3c" stroke="#c0392b" stroke-width="2" rx="3" ry="0" x="350" y="115" width="60" height="25"/>
|
||
|
|
<text fill="#ffffff" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="700" xml:space="preserve" x="380" y="132" data-gn-el-type="text" style="white-space:pre"><tspan>30</tspan></text>
|
||
|
|
<text fill="#7f8c8d" font-family="Arial, sans-serif" font-size="10" xml:space="preserve" x="350" y="108" data-gn-el-type="text" style="white-space:pre"><tspan>Returns:</tspan></text>
|
||
|
|
<text fill="#e74c3c" font-family="Arial, sans-serif" font-size="11" font-weight="700" xml:space="preserve" x="320" y="265" data-gn-el-type="text" style="white-space:pre"><tspan>← TOP</tspan></text>
|
||
|
|
</g>
|
||
|
|
<g id="peek-operation">
|
||
|
|
<text fill="#f39c12" text-anchor="middle" font-family="Arial, sans-serif" font-size="16" font-weight="700" xml:space="preserve" x="520" y="75" data-gn-el-type="text" style="white-space:pre"><tspan>PEEK</tspan></text>
|
||
|
|
<text fill="#7f8c8d" font-family="Arial, sans-serif" font-size="12" xml:space="preserve" x="465" y="95" data-gn-el-type="text" style="white-space:pre"><tspan>View top (no remove)</tspan></text>
|
||
|
|
<rect fill="#ffffff" stroke="#bdc3c7" stroke-width="2" rx="5" ry="0" x="470" y="110" width="100" height="200"/>
|
||
|
|
<rect fill="#3498db" stroke="#2980b9" stroke-width="2" rx="3" ry="0" x="480" y="280" width="80" height="25"/>
|
||
|
|
<text fill="#ffffff" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="700" xml:space="preserve" x="520" y="297" data-gn-el-type="text" style="white-space:pre"><tspan>10</tspan></text>
|
||
|
|
<rect fill="#3498db" stroke="#2980b9" stroke-width="2" rx="3" ry="0" x="480" y="250" width="80" height="25"/>
|
||
|
|
<text fill="#ffffff" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="700" xml:space="preserve" x="520" y="267" data-gn-el-type="text" style="white-space:pre"><tspan>20</tspan></text>
|
||
|
|
<rect fill="#f39c12" stroke="#e67e22" stroke-width="3" rx="3" ry="0" x="480" y="220" width="80" height="25"/>
|
||
|
|
<text fill="#ffffff" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="700" xml:space="preserve" x="520" y="237" data-gn-el-type="text" style="white-space:pre"><tspan>30</tspan></text>
|
||
|
|
<path fill="none" stroke="#f39c12" stroke-width="2" stroke-dasharray="4 4" d="M580,232L620,190"/>
|
||
|
|
<text fill="#f39c12" font-family="Arial, sans-serif" font-size="11" font-weight="700" xml:space="preserve" transform="translate(-2, 12)" x="625" y="185" data-gn-el-type="text" style="white-space:pre"><tspan>View only</tspan></text>
|
||
|
|
<rect fill="#f39c12" stroke="#e67e22" stroke-width="2" rx="3" ry="0" x="610" y="160" width="60" height="25"/>
|
||
|
|
<text fill="#ffffff" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="700" xml:space="preserve" x="640" y="177" data-gn-el-type="text" style="white-space:pre"><tspan>30</tspan></text>
|
||
|
|
<text fill="#7f8c8d" font-family="Arial, sans-serif" font-size="10" xml:space="preserve" x="610" y="153" data-gn-el-type="text" style="white-space:pre"><tspan>Returns:</tspan></text>
|
||
|
|
<text fill="#e74c3c" font-family="Arial, sans-serif" font-size="11" font-weight="700" xml:space="preserve" x="570" y="235" data-gn-el-type="text" style="white-space:pre"><tspan>← TOP</tspan></text>
|
||
|
|
<text fill="#7f8c8d" font-family="Arial, sans-serif" font-size="10" xml:space="preserve" transform="translate(8, 0)" x="470" y="190" data-gn-el-type="text" style="white-space:pre"><tspan>Stack unchanged</tspan></text>
|
||
|
|
</g>
|
||
|
|
<g id="isEmpty-operation">
|
||
|
|
<text fill="#9b59b6" text-anchor="middle" font-family="Arial, sans-serif" font-size="16" font-weight="700" xml:space="preserve" x="780" y="75" data-gn-el-type="text" style="white-space:pre"><tspan>isEmpty</tspan></text>
|
||
|
|
<text fill="#7f8c8d" font-family="Arial, sans-serif" font-size="12" xml:space="preserve" x="730" y="95" data-gn-el-type="text" style="white-space:pre"><tspan>Check if empty</tspan></text>
|
||
|
|
<rect fill="#ffffff" stroke="#bdc3c7" stroke-width="2" rx="5" ry="0" x="730" y="110" width="100" height="200"/>
|
||
|
|
<text fill="#bdc3c7" text-anchor="middle" font-family="Arial, sans-serif" font-style="italic" font-size="14" xml:space="preserve" x="780" y="215" data-gn-el-type="text" style="white-space:pre"><tspan>Empty</tspan></text>
|
||
|
|
<rect fill="#9b59b6" stroke="#8e44ad" stroke-width="2" transform="translate(84.1444, -90.4029)" rx="3" ry="0" x="750" y="250" width="60" height="25"/>
|
||
|
|
<text fill="#ffffff" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="700" xml:space="preserve" transform="translate(84.1444, -90.4029)" x="780" y="267" data-gn-el-type="text" style="white-space:pre"><tspan>true</tspan></text>
|
||
|
|
<text fill="#7f8c8d" font-family="Arial, sans-serif" font-size="10" xml:space="preserve" transform="translate(86.9966, -89.3466)" x="750" y="243" data-gn-el-type="text" style="white-space:pre"><tspan>Returns:</tspan></text>
|
||
|
|
</g>
|
||
|
|
<g id="explanation">
|
||
|
|
<rect fill="#ffffff" stroke="#bdc3c7" stroke-width="2" rx="8" ry="0" x="40" y="330" width="820" height="55"/>
|
||
|
|
<text fill="#2c3e50" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="700" xml:space="preserve" x="450" y="350" data-gn-el-type="text" style="white-space:pre"><tspan>All operations work on the TOP of the stack</tspan></text>
|
||
|
|
<text fill="#7f8c8d" font-family="Arial, sans-serif" font-size="12" xml:space="preserve" transform="translate(-47, 0)" x="100" y="370" data-gn-el-type="text" style="white-space:pre"><tspan>• PUSH adds element to top</tspan></text>
|
||
|
|
<text fill="#7f8c8d" font-family="Arial, sans-serif" font-size="12" xml:space="preserve" transform="translate(-47, 0)" x="300" y="370" data-gn-el-type="text" style="white-space:pre"><tspan>• POP removes and returns top</tspan></text>
|
||
|
|
<text fill="#7f8c8d" font-family="Arial, sans-serif" font-size="12" xml:space="preserve" transform="translate(-47, 0)" x="520" y="370" data-gn-el-type="text" style="white-space:pre"><tspan>• PEEK returns top without removing</tspan></text>
|
||
|
|
<text fill="#7f8c8d" font-family="Arial, sans-serif" font-size="12" xml:space="preserve" transform="translate(-47, 0)" x="760" y="370" data-gn-el-type="text" style="white-space:pre"><tspan>• isEmpty checks size</tspan></text>
|
||
|
|
</g>
|
||
|
|
</svg>
|