mirror of
https://github.com/prdlk/leetcode.git
synced 2026-11-02 13:12:44 +00:00
docs: add hash table operations SVG, prefix‑sum PNG, and redirect for LC 974
This commit is contained in:
1 parent
16317c8645
commit
876868f2a4
3 files changed
+49
No files matched your search
@@ -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 |
Binary file not shown.
|
After Width: | Height: | Size: 43 KiB |
@@ -76,6 +76,7 @@ export default [
|
|||||||
{ from: "/853", to: "/monotonic-stack/car-fleet" },
|
{ from: "/853", to: "/monotonic-stack/car-fleet" },
|
||||||
{ from: "/875", to: "/binary-search/koko-eating-bananas" },
|
{ from: "/875", to: "/binary-search/koko-eating-bananas" },
|
||||||
{ from: "/973", to: "/heap-priority-queue/k-closest-points-to-origin" },
|
{ from: "/973", to: "/heap-priority-queue/k-closest-points-to-origin" },
|
||||||
|
{ from: "/974", to: "/prefix-sum/subarray-sums-divisible-by-k" },
|
||||||
{ from: "/977", to: "/two-pointers/squares-of-a-sorted-array" },
|
{ from: "/977", to: "/two-pointers/squares-of-a-sorted-array" },
|
||||||
{ from: "/994", to: "/graph-bfs/rotting-oranges" },
|
{ from: "/994", to: "/graph-bfs/rotting-oranges" },
|
||||||
{ from: "/1143", to: "/multi-d-grid-dp/longest-common-subsequence" },
|
{ from: "/1143", to: "/multi-d-grid-dp/longest-common-subsequence" },
|
||||||
|
|||||||
Reference in new issue
Block a user