feat: refactored docs structure
No files matched your search
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 45 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 37 KiB |
|
After Width: | Height: | Size: 47 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 43 KiB |
@@ -0,0 +1,48 @@
|
||||
<svg viewBox="0 0 650 280" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect width="650" height="280" fill="#f8f9fa" rx="10"/>
|
||||
|
||||
<!-- Title -->
|
||||
<text x="325" y="30" font-family="Arial, sans-serif" font-size="18" font-weight="bold" text-anchor="middle" fill="#2c3e50">Hash Table: Three Core Operations (All O(1))</text>
|
||||
|
||||
<!-- Insert -->
|
||||
<rect x="50" y="60" width="180" height="180" fill="#ffffff" stroke="#27ae60" stroke-width="3" rx="8"/>
|
||||
<text x="140" y="85" font-family="Arial, sans-serif" font-size="15" font-weight="bold" text-anchor="middle" fill="#27ae60">INSERT</text>
|
||||
|
||||
<text x="140" y="115" font-family="monospace" font-size="13" text-anchor="middle" fill="#2c3e50">map["Alice"] = </text>
|
||||
<text x="140" y="135" font-family="monospace" font-size="13" text-anchor="middle" fill="#2c3e50">"555-1234"</text>
|
||||
|
||||
<text x="140" y="170" font-family="Arial, sans-serif" font-size="11" text-anchor="middle" fill="#7f8c8d">1. Hash "Alice"</text>
|
||||
<text x="140" y="188" font-family="Arial, sans-serif" font-size="11" text-anchor="middle" fill="#7f8c8d">2. Compute index</text>
|
||||
<text x="140" y="206" font-family="Arial, sans-serif" font-size="11" text-anchor="middle" fill="#7f8c8d">3. Store at index</text>
|
||||
|
||||
<text x="140" y="230" font-family="Arial, sans-serif" font-size="13" font-weight="bold" text-anchor="middle" fill="#27ae60">O(1)</text>
|
||||
|
||||
<!-- Lookup -->
|
||||
<rect x="240" y="60" width="180" height="180" fill="#ffffff" stroke="#3498db" stroke-width="3" rx="8"/>
|
||||
<text x="330" y="85" font-family="Arial, sans-serif" font-size="15" font-weight="bold" text-anchor="middle" fill="#3498db">LOOKUP</text>
|
||||
|
||||
<text x="330" y="115" font-family="monospace" font-size="13" text-anchor="middle" fill="#2c3e50">value = </text>
|
||||
<text x="330" y="135" font-family="monospace" font-size="13" text-anchor="middle" fill="#2c3e50">map["Alice"]</text>
|
||||
|
||||
<text x="330" y="170" font-family="Arial, sans-serif" font-size="11" text-anchor="middle" fill="#7f8c8d">1. Hash "Alice"</text>
|
||||
<text x="330" y="188" font-family="Arial, sans-serif" font-size="11" text-anchor="middle" fill="#7f8c8d">2. Compute index</text>
|
||||
<text x="330" y="206" font-family="Arial, sans-serif" font-size="11" text-anchor="middle" fill="#7f8c8d">3. Read from index</text>
|
||||
|
||||
<text x="330" y="230" font-family="Arial, sans-serif" font-size="13" font-weight="bold" text-anchor="middle" fill="#3498db">O(1)</text>
|
||||
|
||||
<!-- Delete -->
|
||||
<rect x="430" y="60" width="180" height="180" fill="#ffffff" stroke="#e74c3c" stroke-width="3" rx="8"/>
|
||||
<text x="520" y="85" font-family="Arial, sans-serif" font-size="15" font-weight="bold" text-anchor="middle" fill="#e74c3c">DELETE</text>
|
||||
|
||||
<text x="520" y="115" font-family="monospace" font-size="13" text-anchor="middle" fill="#2c3e50">delete</text>
|
||||
<text x="520" y="135" font-family="monospace" font-size="13" text-anchor="middle" fill="#2c3e50">map["Alice"]</text>
|
||||
|
||||
<text x="520" y="170" font-family="Arial, sans-serif" font-size="11" text-anchor="middle" fill="#7f8c8d">1. Hash "Alice"</text>
|
||||
<text x="520" y="188" font-family="Arial, sans-serif" font-size="11" text-anchor="middle" fill="#7f8c8d">2. Compute index</text>
|
||||
<text x="520" y="206" font-family="Arial, sans-serif" font-size="11" text-anchor="middle" fill="#7f8c8d">3. Remove from index</text>
|
||||
|
||||
<text x="520" y="230" font-family="Arial, sans-serif" font-size="13" font-weight="bold" text-anchor="middle" fill="#e74c3c">O(1)</text>
|
||||
|
||||
<!-- Bottom note -->
|
||||
<text x="325" y="265" font-family="Arial, sans-serif" font-size="13" text-anchor="middle" fill="#7f8c8d">All operations complete in constant time (on average)</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 50 KiB |
@@ -0,0 +1,29 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1166 466" width="1166" height="466" font-family="Inter, Helvetica, Arial, sans-serif" xmlns:c2pa="http://c2pa.org/manifest"><metadata><c2pa:manifest>AAAWgmp1bWIAAAAeanVtZGMycGEAEQAQgAAAqgA4m3EDYzJwYQAAABZcanVtYgAAAEdqdW1kYzJtYQARABCAAACqADibcQN1cm46YzJwYTplNTQ2ZmQ3OS1hNTQwLTQwYzctYjMxZC1mOWYyODMxZWUwN2YAAAADl2p1bWIAAAApanVtZGMyYXMAEQAQgAAAqgA4m3EDYzJwYS5hc3NlcnRpb25zAAAAALxqdW1iAAAARGp1bWRjYm9yABEAEIAAAKoAOJtxE2MycGEuaW5ncmVkaWVudC52MwAAAAAYYzJzaPzccOzcNqqGwCVEue2cwv0AAABwY2JvcqNpZGM6Zm9ybWF0bWltYWdlL3N2Zyt4bWxqaW5zdGFuY2VJRHgseG1wOmlpZDo3OGU1MmE0MS1iMWZjLTQ5MTItOGFkNC1kMjQzODM2MjAyZTRscmVsYXRpb25zaGlwaHBhcmVudE9mAAAB4mp1bWIAAABBanVtZGNib3IAEQAQgAAAqgA4m3ETYzJwYS5hY3Rpb25zLnYyAAAAABhjMnNocPSh2E7eebWNUztuxZwhMAAAAZljYm9yomdhY3Rpb25zgqJmYWN0aW9ua2MycGEub3BlbmVkanBhcmFtZXRlcnOha2luZ3JlZGllbnRzgaJjdXJseC1zZWxmI2p1bWJmPWMycGEuYXNzZXJ0aW9ucy9jMnBhLmluZ3JlZGllbnQudjNkaGFzaFggfICJhx/gC3AGlwvd6lmmDILnZfr/OwUArljCD0UDNCWkZmFjdGlvbngdY29tLmFudGhyb3BpYy5jb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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALine truncated
|
||||
<rect width="1166" height="466" fill="#f4f5f7"/>
|
||||
|
||||
<!-- Title -->
|
||||
<text x="265" y="50" font-size="28" font-weight="700" fill="#2d3a4a">Merge = [min(starts), max(ends)]</text>
|
||||
|
||||
<!-- Guide lines at the outer edges (merge bounds) -->
|
||||
<line x1="242" y1="115" x2="242" y2="290" stroke="#7f8790" stroke-width="2" stroke-dasharray="6 5"/>
|
||||
<line x1="971" y1="115" x2="971" y2="290" stroke="#7f8790" stroke-width="2" stroke-dasharray="6 5"/>
|
||||
|
||||
<!-- x = [2, 8] -->
|
||||
<text x="238" y="108" font-size="20" fill="#4a5563" font-family="JetBrains Mono, Menlo, Consolas, monospace" text-anchor="middle">2</text>
|
||||
<text x="728" y="108" font-size="20" fill="#4a5563" font-family="JetBrains Mono, Menlo, Consolas, monospace" text-anchor="middle">8</text>
|
||||
<text x="200" y="152" font-size="22" font-weight="600" fill="#3598db" text-anchor="middle">x</text>
|
||||
<rect x="242" y="121" width="486" height="44" rx="6" fill="#3598db"/>
|
||||
|
||||
<!-- y = [5, 11] -->
|
||||
<text x="200" y="218" font-size="22" font-weight="600" fill="#f39c12" text-anchor="middle">y</text>
|
||||
<rect x="485" y="187" width="486" height="44" rx="6" fill="#f39c12"/>
|
||||
<text x="485" y="260" font-size="20" fill="#4a5563" font-family="JetBrains Mono, Menlo, Consolas, monospace" text-anchor="middle">5</text>
|
||||
<text x="966" y="260" font-size="20" fill="#4a5563" font-family="JetBrains Mono, Menlo, Consolas, monospace" text-anchor="middle">11</text>
|
||||
|
||||
<!-- Merged result -->
|
||||
<rect x="242" y="297" width="729" height="22" rx="5" fill="#d5f5e3" stroke="#27ae60" stroke-width="2.5"/>
|
||||
<text x="606" y="358" font-size="22" fill="#27ae60" font-family="JetBrains Mono, Menlo, Consolas, monospace" text-anchor="middle">merge = [2, 11]</text>
|
||||
|
||||
<!-- Worked formula -->
|
||||
<text x="265" y="430" font-size="22" fill="#2d3a4a" font-family="JetBrains Mono, Menlo, Consolas, monospace">min(2, 5) = 2 and max(8, 11) = 11</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 9.6 KiB |
@@ -0,0 +1,28 @@
|
||||
<svg viewBox="0 0 820 380" xmlns="http://www.w3.org/2000/svg">
|
||||
<!-- Background (REQUIRED) - MUST BE FIRST ELEMENT -->
|
||||
<rect width="820" height="380" fill="#f8f9fa" rx="10"/>
|
||||
|
||||
<!-- Title (left-anchored, manually centered) -->
|
||||
<text x="239" y="44" font-family="Arial, sans-serif" font-size="22" font-weight="bold" fill="#2c3e50">When do intervals overlap?</text>
|
||||
|
||||
<!-- Panel 1: no overlap. Labels sit OUTSIDE the bars. -->
|
||||
<text x="60" y="94" font-family="Arial, sans-serif" font-size="16" fill="#2c3e50">No overlap: a ends before b starts</text>
|
||||
<text x="90" y="132" font-family="Arial, sans-serif" font-size="16" font-weight="bold" fill="#3498db">a</text>
|
||||
<rect x="110" y="110" width="180" height="32" fill="#3498db" rx="4"/>
|
||||
<text x="330" y="132" font-family="Arial, sans-serif" font-size="16" font-weight="bold" fill="#f39c12">b</text>
|
||||
<rect x="350" y="110" width="180" height="32" fill="#f39c12" rx="4"/>
|
||||
<text x="560" y="132" font-family="monospace" font-size="18" fill="#2c3e50">a.end < b.start</text>
|
||||
|
||||
<!-- Panel 2: overlap. Bars on separate rows so they never visually collide. -->
|
||||
<text x="60" y="210" font-family="Arial, sans-serif" font-size="16" fill="#2c3e50">Overlap: their times cross</text>
|
||||
<text x="90" y="250" font-family="Arial, sans-serif" font-size="16" font-weight="bold" fill="#3498db">a</text>
|
||||
<rect x="110" y="228" width="240" height="32" fill="#3498db" rx="4"/>
|
||||
<text x="480" y="300" font-family="Arial, sans-serif" font-size="16" font-weight="bold" fill="#f39c12">b</text>
|
||||
<rect x="230" y="278" width="240" height="32" fill="#f39c12" rx="4"/>
|
||||
|
||||
<!-- guide lines marking the shared x-range (paths, no arrowheads) -->
|
||||
<path d="M 230,224 L 230,314" stroke="#7f8c8d" stroke-width="1.5" stroke-dasharray="4 3" fill="none"/>
|
||||
<path d="M 350,224 L 350,314" stroke="#7f8c8d" stroke-width="1.5" stroke-dasharray="4 3" fill="none"/>
|
||||
<rect x="230" y="324" width="120" height="12" fill="#d1fae5" stroke="#10b981" stroke-width="1.5" rx="3"/>
|
||||
<text x="244" y="362" font-family="Arial, sans-serif" font-size="15" fill="#27ae60">shared = [max start, min end]</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.1 KiB |
@@ -0,0 +1,28 @@
|
||||
<svg viewBox="0 0 820 340" xmlns="http://www.w3.org/2000/svg">
|
||||
<!-- Background (REQUIRED) - MUST BE FIRST ELEMENT -->
|
||||
<rect width="820" height="340" fill="#f8f9fa" rx="10"/>
|
||||
|
||||
<!-- Title (left-anchored, manually centered) -->
|
||||
<text x="206" y="42" font-family="Arial, sans-serif" font-size="20" font-weight="bold" fill="#2c3e50">Overlap = [max(starts), min(ends)]</text>
|
||||
|
||||
<!-- interval x = [2, 8]; endpoints labeled ABOVE the bar -->
|
||||
<text x="184" y="82" font-family="monospace" font-size="15" fill="#2c3e50">2</text>
|
||||
<text x="512" y="82" font-family="monospace" font-size="15" fill="#2c3e50">8</text>
|
||||
<text x="158" y="112" font-family="monospace" font-size="16" font-weight="bold" fill="#3498db">x</text>
|
||||
<rect x="190" y="90" width="330" height="30" fill="#3498db" rx="4"/>
|
||||
|
||||
<!-- interval y = [5, 11]; endpoints labeled BELOW the bar -->
|
||||
<text x="158" y="157" font-family="monospace" font-size="16" font-weight="bold" fill="#f39c12">y</text>
|
||||
<rect x="355" y="135" width="330" height="30" fill="#f39c12" rx="4"/>
|
||||
<text x="349" y="185" font-family="monospace" font-size="15" fill="#2c3e50">5</text>
|
||||
<text x="672" y="185" font-family="monospace" font-size="15" fill="#2c3e50">11</text>
|
||||
|
||||
<!-- shared range [5, 8] -->
|
||||
<path d="M 355,86 L 355,205" stroke="#7f8c8d" stroke-width="1.5" stroke-dasharray="4 3" fill="none"/>
|
||||
<path d="M 520,86 L 520,205" stroke="#7f8c8d" stroke-width="1.5" stroke-dasharray="4 3" fill="none"/>
|
||||
<rect x="355" y="210" width="165" height="14" fill="#d1fae5" stroke="#10b981" stroke-width="2" rx="3"/>
|
||||
<text x="405" y="252" font-family="monospace" font-size="16" font-weight="bold" fill="#27ae60">overlap = [5, 8]</text>
|
||||
|
||||
<!-- computation -->
|
||||
<text x="206" y="300" font-family="monospace" font-size="16" fill="#2c3e50">max(2, 5) = 5 and min(8, 11) = 8</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.8 KiB |
@@ -0,0 +1,17 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 94 110.92">
|
||||
<defs/>
|
||||
<g id="LeetCode’s-new-logo" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g transform="translate(-812.000000, -3714.000000)" id="logo_english_dark">
|
||||
<g transform="translate(812.000000, 3714.000000)">
|
||||
<g id="Logo_English">
|
||||
<g id="Group-10">
|
||||
<path d="M67.5068339,83.0664138 C70.0005384,80.5763786 74.0371402,80.5828822 76.5228362,83.0809398 C79.0085322,85.5789975 79.00204,89.6226456 76.5083355,92.1126808 L65.4351451,103.169577 C55.2192332,113.370744 38.5604663,113.518673 28.1722578,103.513204 C28.112217,103.455678 23.486583,98.9201326 8.22702585,83.9570195 C-1.92478479,74.0028895 -2.93614945,58.0748736 6.61697549,47.8463644 L24.4286944,28.7745461 C33.9100043,18.6218594 51.3874487,17.5122246 62.2279907,26.2789232 L78.4052912,39.3620235 C81.1448956,41.5776292 81.5728103,45.5984975 79.3610655,48.3428842 C77.1493207,51.0872709 73.1354592,51.5159327 70.3958548,49.300327 L54.2186634,36.2173149 C48.5492813,31.6325105 38.631911,32.2621597 33.7398535,37.5006265 L15.9279056,56.5726899 C11.2772073,61.552182 11.7865613,69.5740156 17.1461283,74.8292186 C28.3515339,85.8169393 36.9874071,94.2846214 36.9973988,94.294225 C42.3981571,99.4959838 51.130862,99.418438 56.43358,94.1233737 L67.5068339,83.0664138 Z" id="Combined-Shape" fill="#FFA116" fill-rule="nonzero"/>
|
||||
<path d="M40.6069914,72.0014117 C37.086019,72.0014117 34.2317068,69.142117 34.2317068,65.6149982 C34.2317068,62.0878794 37.086019,59.2285847 40.6069914,59.2285847 L87.6247154,59.2285847 C91.1456879,59.2285847 94,62.0878794 94,65.6149982 C94,69.142117 91.1456879,72.0014117 87.6247154,72.0014117 L40.6069914,72.0014117 Z" id="Path-2" fill="#B3B3B3"/>
|
||||
<path d="M49.4124315,2.02335002 C51.8178981,-0.552320454 55.852269,-0.686893945 58.4234511,1.72277172 C60.9946333,4.13243738 61.1289722,8.17385083 58.7235056,10.7495213 L15.9282277,56.5728697 C11.2773659,61.551984 11.7867168,69.5737689 17.1459309,74.8291832 L36.9094236,94.2091099 C39.4255514,96.6764051 39.4686234,100.719828 37.0056277,103.240348 C34.5426319,105.760868 30.5062548,105.804016 27.990127,103.33672 L8.22654289,83.9567041 C-1.92467414,74.0021005 -2.93603527,58.0741402 6.61751533,47.846311 L49.4124315,2.02335002 Z" id="Stroke-3" fill="#fff"/>
|
||||
</g>
|
||||
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 43 KiB |
@@ -0,0 +1,66 @@
|
||||
<svg viewBox="0 0 800 450" xmlns="http://www.w3.org/2000/svg">
|
||||
<!-- Background (REQUIRED) -->
|
||||
<rect width="800" height="450" fill="#f8f9fa" rx="10"/>
|
||||
|
||||
<!-- Title and Subtitle -->
|
||||
<text x="400" y="45" font-family="Arial, sans-serif" font-size="26" font-weight="bold" fill="#2c3e50" text-anchor="middle">Sliding Window: Fixed Size</text>
|
||||
<text x="400" y="75" font-family="Arial, sans-serif" font-size="16" fill="#7f8c8d" text-anchor="middle">Window of size K=3 moving through the array.</text>
|
||||
|
||||
<!-- Step 1: Initial window -->
|
||||
<g transform="translate(150, 130)">
|
||||
<text x="0" y="-20" font-family="Arial, sans-serif" font-size="18" font-weight="bold" fill="#2c3e50">1. Current window (Sum = 10)</text>
|
||||
|
||||
<!-- Array -->
|
||||
<g transform="translate(0, 20)">
|
||||
<rect x="0" y="0" width="60" height="50" fill="#d1fae5" stroke="#10b981" stroke-width="3" rx="3"/>
|
||||
<text x="30" y="32" font-family="monospace" font-size="22" text-anchor="middle" fill="#1b5e20">2</text>
|
||||
|
||||
<rect x="70" y="0" width="60" height="50" fill="#d1fae5" stroke="#10b981" stroke-width="3" rx="3"/>
|
||||
<text x="100" y="32" font-family="monospace" font-size="22" text-anchor="middle" fill="#1b5e20">3</text>
|
||||
|
||||
<rect x="140" y="0" width="60" height="50" fill="#d1fae5" stroke="#10b981" stroke-width="3" rx="3"/>
|
||||
<text x="170" y="32" font-family="monospace" font-size="22" text-anchor="middle" fill="#1b5e20">5</text>
|
||||
|
||||
<rect x="210" y="0" width="60" height="50" fill="#ffffff" stroke="#dee2e6" stroke-width="2" rx="3"/>
|
||||
<text x="240" y="32" font-family="monospace" font-size="22" text-anchor="middle" fill="#2c3e50">1</text>
|
||||
|
||||
<rect x="280" y="0" width="60" height="50" fill="#ffffff" stroke="#dee2e6" stroke-width="2" rx="3"/>
|
||||
<text x="310" y="32" font-family="monospace" font-size="22" text-anchor="middle" fill="#2c3e50">8</text>
|
||||
|
||||
<!-- Bracket -->
|
||||
<path d="M 0,60 L 0,70 L 200,70 L 200,60" fill="none" stroke="#10b981" stroke-width="2"/>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
<!-- Transition -->
|
||||
<g transform="translate(400, 260)">
|
||||
<path d="M 0,0 L 0,30" stroke="#dee2e6" stroke-width="2" fill="none"/>
|
||||
<text x="10" y="20" font-family="Arial, sans-serif" font-size="14" font-style="italic" fill="#7f8c8d">Slide window: -2, +1</text>
|
||||
</g>
|
||||
|
||||
<!-- Step 2: Slid window -->
|
||||
<g transform="translate(150, 340)">
|
||||
<text x="0" y="-20" font-family="Arial, sans-serif" font-size="18" font-weight="bold" fill="#2c3e50">2. Next window (Sum = 9)</text>
|
||||
|
||||
<!-- Array -->
|
||||
<g transform="translate(0, 20)">
|
||||
<rect x="0" y="0" width="60" height="50" fill="#e5e7eb" stroke="#94a3b8" stroke-width="2" rx="3"/>
|
||||
<text x="30" y="32" font-family="monospace" font-size="22" text-anchor="middle" fill="#94a3b8">2</text>
|
||||
|
||||
<rect x="70" y="0" width="60" height="50" fill="#d1fae5" stroke="#10b981" stroke-width="3" rx="3"/>
|
||||
<text x="100" y="32" font-family="monospace" font-size="22" text-anchor="middle" fill="#1b5e20">3</text>
|
||||
|
||||
<rect x="140" y="0" width="60" height="50" fill="#d1fae5" stroke="#10b981" stroke-width="3" rx="3"/>
|
||||
<text x="170" y="32" font-family="monospace" font-size="22" text-anchor="middle" fill="#1b5e20">5</text>
|
||||
|
||||
<rect x="210" y="0" width="60" height="50" fill="#d1fae5" stroke="#10b981" stroke-width="3" rx="3"/>
|
||||
<text x="240" y="32" font-family="monospace" font-size="22" text-anchor="middle" fill="#1b5e20">1</text>
|
||||
|
||||
<rect x="280" y="0" width="60" height="50" fill="#ffffff" stroke="#dee2e6" stroke-width="2" rx="3"/>
|
||||
<text x="310" y="32" font-family="monospace" font-size="22" text-anchor="middle" fill="#2c3e50">8</text>
|
||||
|
||||
<!-- Bracket -->
|
||||
<path d="M 70,60 L 70,70 L 270,70 L 270,60" fill="none" stroke="#10b981" stroke-width="2"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.7 KiB |
@@ -0,0 +1,66 @@
|
||||
<svg viewBox="0 0 800 450" xmlns="http://www.w3.org/2000/svg">
|
||||
<!-- Background (REQUIRED) -->
|
||||
<rect width="800" height="450" fill="#f8f9fa" rx="10"/>
|
||||
|
||||
<!-- Title and Subtitle -->
|
||||
<text x="400" y="45" font-family="Arial, sans-serif" font-size="26" font-weight="bold" fill="#2c3e50" text-anchor="middle">Sliding Window: Flexible Size</text>
|
||||
<text x="400" y="75" font-family="Arial, sans-serif" font-size="16" fill="#7f8c8d" text-anchor="middle">Window expands until invalid, then shrinks until valid again.</text>
|
||||
|
||||
<!-- Step 1: Invalid state -->
|
||||
<g transform="translate(150, 130)">
|
||||
<text x="0" y="-20" font-family="Arial, sans-serif" font-size="18" font-weight="bold" fill="#2c3e50">1. Expansion breaks invariant</text>
|
||||
|
||||
<!-- Array -->
|
||||
<g transform="translate(0, 20)">
|
||||
<rect x="0" y="0" width="60" height="50" fill="#fee2e2" stroke="#ef4444" stroke-width="3" rx="3"/>
|
||||
<text x="30" y="32" font-family="monospace" font-size="22" text-anchor="middle" fill="#2c3e50">a</text>
|
||||
<polygon points="30,60 25,70 35,70" fill="#27ae60"/>
|
||||
<text x="30" y="85" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#27ae60" text-anchor="middle">L</text>
|
||||
|
||||
<rect x="70" y="0" width="60" height="50" fill="#fee2e2" stroke="#ef4444" stroke-width="3" rx="3"/>
|
||||
<text x="100" y="32" font-family="monospace" font-size="22" text-anchor="middle" fill="#2c3e50">b</text>
|
||||
|
||||
<rect x="140" y="0" width="60" height="50" fill="#fee2e2" stroke="#ef4444" stroke-width="3" rx="3"/>
|
||||
<text x="170" y="32" font-family="monospace" font-size="22" text-anchor="middle" fill="#2c3e50">c</text>
|
||||
|
||||
<rect x="210" y="0" width="60" height="50" fill="#fee2e2" stroke="#ef4444" stroke-width="4" rx="3"/>
|
||||
<text x="240" y="32" font-family="monospace" font-size="22" text-anchor="middle" fill="#2c3e50">a</text>
|
||||
<polygon points="240,60 235,70 245,70" fill="#3498db"/>
|
||||
<text x="240" y="85" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#3498db" text-anchor="middle">R</text>
|
||||
|
||||
<text x="300" y="32" font-family="Arial, sans-serif" font-size="14" fill="#ef4444" font-weight="bold">Duplicate 'a'!</text>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
<!-- Transition -->
|
||||
<g transform="translate(400, 260)">
|
||||
<path d="M 0,0 L 0,30" stroke="#dee2e6" stroke-width="2" fill="none"/>
|
||||
<text x="10" y="20" font-family="Arial, sans-serif" font-size="14" font-style="italic" fill="#7f8c8d">Shrink from left</text>
|
||||
</g>
|
||||
|
||||
<!-- Step 2: Valid again -->
|
||||
<g transform="translate(150, 340)">
|
||||
<text x="0" y="-20" font-family="Arial, sans-serif" font-size="18" font-weight="bold" fill="#2c3e50">2. Invariant restored</text>
|
||||
|
||||
<!-- Array -->
|
||||
<g transform="translate(0, 20)">
|
||||
<rect x="0" y="0" width="60" height="50" fill="#e5e7eb" stroke="#94a3b8" stroke-width="2" rx="3"/>
|
||||
<text x="30" y="32" font-family="monospace" font-size="22" text-anchor="middle" fill="#94a3b8">a</text>
|
||||
|
||||
<rect x="70" y="0" width="60" height="50" fill="#d1fae5" stroke="#10b981" stroke-width="3" rx="3"/>
|
||||
<text x="100" y="32" font-family="monospace" font-size="22" text-anchor="middle" fill="#2c3e50">b</text>
|
||||
<polygon points="100,60 95,70 105,70" fill="#27ae60"/>
|
||||
<text x="100" y="85" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#27ae60" text-anchor="middle">L</text>
|
||||
|
||||
<rect x="140" y="0" width="60" height="50" fill="#d1fae5" stroke="#10b981" stroke-width="3" rx="3"/>
|
||||
<text x="170" y="32" font-family="monospace" font-size="22" text-anchor="middle" fill="#2c3e50">c</text>
|
||||
|
||||
<rect x="210" y="0" width="60" height="50" fill="#d1fae5" stroke="#10b981" stroke-width="3" rx="3"/>
|
||||
<text x="240" y="32" font-family="monospace" font-size="22" text-anchor="middle" fill="#2c3e50">a</text>
|
||||
<polygon points="240,60 235,70 245,70" fill="#3498db"/>
|
||||
<text x="240" y="85" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#3498db" text-anchor="middle">R</text>
|
||||
|
||||
<text x="300" y="32" font-family="Arial, sans-serif" font-size="14" fill="#10b981" font-weight="bold">Valid again!</text>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.1 KiB |
@@ -0,0 +1,54 @@
|
||||
<svg viewBox="0 0 800 450" xmlns="http://www.w3.org/2000/svg">
|
||||
<!-- Background (REQUIRED) -->
|
||||
<rect width="800" height="450" fill="#f8f9fa" rx="10"/>
|
||||
|
||||
<!-- Title and Subtitle -->
|
||||
<text x="400" y="45" font-family="Arial, sans-serif" font-size="26" font-weight="bold" fill="#2c3e50" text-anchor="middle">Sliding Window: Frequency Tracking</text>
|
||||
<text x="400" y="75" font-family="Arial, sans-serif" font-size="16" fill="#7f8c8d" text-anchor="middle">Maintaining a character frequency map for the current window.</text>
|
||||
|
||||
<!-- Left: Window -->
|
||||
<g transform="translate(100, 150)">
|
||||
<text x="0" y="-30" font-family="Arial, sans-serif" font-size="18" font-weight="bold" fill="#2c3e50">Current Window</text>
|
||||
|
||||
<!-- Array -->
|
||||
<g transform="translate(0, 20)">
|
||||
<rect x="0" y="0" width="60" height="50" fill="#d1fae5" stroke="#10b981" stroke-width="3" rx="3"/>
|
||||
<text x="30" y="32" font-family="monospace" font-size="22" text-anchor="middle" fill="#2c3e50">a</text>
|
||||
<polygon points="30,60 25,70 35,70" fill="#27ae60"/>
|
||||
<text x="30" y="85" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#27ae60" text-anchor="middle">L</text>
|
||||
|
||||
<rect x="70" y="0" width="60" height="50" fill="#d1fae5" stroke="#10b981" stroke-width="3" rx="3"/>
|
||||
<text x="100" y="32" font-family="monospace" font-size="22" text-anchor="middle" fill="#2c3e50">b</text>
|
||||
|
||||
<rect x="140" y="0" width="60" height="50" fill="#d1fae5" stroke="#10b981" stroke-width="3" rx="3"/>
|
||||
<text x="170" y="32" font-family="monospace" font-size="22" text-anchor="middle" fill="#2c3e50">a</text>
|
||||
<polygon points="170,60 165,70 175,70" fill="#3498db"/>
|
||||
<text x="170" y="85" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#3498db" text-anchor="middle">R</text>
|
||||
|
||||
<rect x="210" y="0" width="60" height="50" fill="#ffffff" stroke="#dee2e6" stroke-width="2" rx="3"/>
|
||||
<text x="240" y="32" font-family="monospace" font-size="22" text-anchor="middle" fill="#2c3e50">c</text>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
<!-- Right: Frequency Map -->
|
||||
<g transform="translate(500, 150)">
|
||||
<text x="0" y="-30" font-family="Arial, sans-serif" font-size="18" font-weight="bold" fill="#2c3e50">Frequency Map</text>
|
||||
|
||||
<!-- Map Container -->
|
||||
<rect x="0" y="0" width="150" height="120" fill="#ffffff" stroke="#dee2e6" stroke-width="2" rx="8"/>
|
||||
|
||||
<!-- Entries -->
|
||||
<g transform="translate(25, 35)">
|
||||
<text x="0" y="0" font-family="monospace" font-size="18" fill="#2c3e50">'a' : 2</text>
|
||||
<text x="0" y="30" font-family="monospace" font-size="18" fill="#2c3e50">'b' : 1</text>
|
||||
<text x="0" y="60" font-family="monospace" font-size="18" fill="#7f8c8d">'c' : 0</text>
|
||||
</g>
|
||||
|
||||
<!-- Invariant label -->
|
||||
<rect x="-20" y="140" width="190" height="40" fill="#e3f2fd" stroke="#3498db" stroke-width="1" rx="5"/>
|
||||
<text x="75" y="165" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#1565c0" text-anchor="middle">INVARIANT: SYNCED STATE</text>
|
||||
</g>
|
||||
|
||||
<!-- Connector -->
|
||||
<path d="M 380,195 L 480,195" stroke="#dee2e6" stroke-width="2" stroke-dasharray="5,5" fill="none"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.1 KiB |
|
After Width: | Height: | Size: 64 KiB |
|
After Width: | Height: | Size: 87 KiB |
|
After Width: | Height: | Size: 70 KiB |
|
After Width: | Height: | Size: 80 KiB |
|
After Width: | Height: | Size: 74 KiB |
|
After Width: | Height: | Size: 68 KiB |
|
After Width: | Height: | Size: 69 KiB |
|
After Width: | Height: | Size: 62 KiB |
|
After Width: | Height: | Size: 64 KiB |
|
After Width: | Height: | Size: 56 KiB |
|
After Width: | Height: | Size: 48 KiB |