Zum Hauptinhalt springen
ProdukteDesktop-WerkzeugeTASTECADZeichnungsprüfungTASTEFILESDateiverwaltungTASTEFTPDateiübertragungTASTESSHRemote-ArbeitsbereichTASTEZIPKomprimieren und EntpackenTASTEWINMDateiverwaltungEntwicklerwerkzeugeTASTECODEIntegrierte Entwicklungsumgebung für RustTASTESTUDIOIntegrierte Entwicklungs- und TestumgebungTASTEETLDatenintegration (ETL)ServerTASTEREMOTERemote-Desktop-ServerTASTEGEOGeodatenserverTASTEMAILE-Mail-ArbeitsbereichInvestierenTASTESTOCKDesktop-App für automatischen AktienhandelErste SchritteDownloadsDokumentationKaufenAlle Produkte
Marktplatz
Neuigkeiten
TechnikNeuigkeitenEntwickler-News von heuteEntwicklerdokuProgrammiersprachenRustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDartWeb-Frontend-FrameworksNext.jsReactVue.js · NuxtSvelteKitAngularServer-FrameworksSpring BootDjangoFastAPIASP.NET CoreNestJS · ExpressApp- & Desktop-FrameworksTauriFlutterReact NativeElectronAlgorithmenAlgorithmus-GrundlagenKernalgorithmenFortgeschrittene AlgorithmenAlgorithmen für die Praxis
CommunityProjekteEntwicklungslogsPromptsProbleme mit KI-ToolsShowcaseCommunity-Leitfaden
ZusammenarbeitWissenstransferWebsite-AufbauDesktop-App-AufbauRelease- und ZahlungspipelineVertriebspartnerKontakt
DiensteRemote-DesktopIndividuelle Installationspakete
TASTEDEV
Produkte

Desktop-Werkzeuge

TASTECADKomplexe Zeichnungen, mühelos geöffnetTASTEFILESNur die Dateien, die zählen – in BestzeitTASTEFTPDer aufgeräumteste Weg für Ihre DateienTASTESSHDie stärkere Verbindung zu Ihren ServernTASTEZIPSchneller packen, sicherer entpackenTASTEWINMEin tastaturorientierter Dateimanager mit zwei Fenstern

Entwicklerwerkzeuge

TASTECODERust-Apps bearbeiten, bauen, debuggen und testen – alles in einem FensterTASTESTUDIOVom Bearbeiten bis zu Remote-Tests und freigegebenen KI-KorrekturenTASTEETLDaten bewegen, die Werte im Blick

Server

TASTEREMOTEEin Remote-Desktop auf Ihrem eigenen ServerTASTEGEOEin GeoServer-kompatibler Geodatenserver, neu aufgebaut in RustTASTEMAILIhre E-Mail wieder in Ihrer Hand

Investieren

TASTESTOCKAutomatischer Aktienhandel nach Ihren Regeln: wann und was

Erste Schritte

DownloadsNeueste Versionen aller ProdukteDokuSo nutzen Sie jedes ProduktKaufenAbos und DauerlizenzenAlle ProdukteAlle Produkte im Überblick
Alle Produkte
MarktplatzNeuigkeiten
Technik

Neuigkeiten

Entwickler-News von heuteOffizielle Meldungen zu Sprachen, Frameworks, GitHub und KIEntwicklerdokuAnleitungen zu Sprachen, Frameworks und Algorithmen

Programmiersprachen

RustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDart

Frameworks

Web-Frontend-FrameworksNext.jsReactVue.js · NuxtSvelteKitAngular
Server-FrameworksSpring BootDjangoFastAPIASP.NET CoreNestJS · Express
App- & Desktop-FrameworksTauriFlutterReact NativeElectron

Algorithmen

Algorithmus-GrundlagenKomplexitätsanalyse · Sortieren · Suchen · Grundlegende Datenstrukturen · Bäume und HeapsKernalgorithmenGraphtraversierung · Kürzeste Wege und minimale Spannbäume · Dynamische Programmierung · Greedy-Algorithmen · Teile und herrsche · BacktrackingFortgeschrittene AlgorithmenZeichenkettenalgorithmen · Mathematik und Zahlentheorie · Bitmanipulation · Segmentbäume · Union-FindAlgorithmen für die PraxisStrategie für Coding-Interviews · LRU-Cache · Rate Limiting · Konsistentes Hashing
Alle Entwicklungsdokumente
Community
ProjekteEntwickler und Projekte entdeckenEntwicklungslogsEntscheidungen und ErkenntnissePromptsWiederverwendbare AnweisungenProbleme mit KI-ToolsProbleme und Workarounds für Claude, Codex, GeminiShowcaseFertige ErgebnisseCommunity-LeitfadenWie wir offen entwickeln
Zusammenarbeit
WissenstransferNative Apps mit Rust und eguiWebsite-Aufbau10 Sprachen, Konten, Dokumentation und DownloadsDesktop-App-AufbauRust und egui, ohne WebViewRelease- und ZahlungspipelineSignatur, MSI, deb, rpm, AppImage, PrüfsummenVertriebspartnerEmpfehlen und 30 % erhaltenKontaktEntwicklung, Partnerschaft, Investition
Dienste
Remote-DesktopIhren Computer im Browser erreichenIndividuelle InstallationspaketeNur nötige Funktionen, Einstellungen vorab
Kaufen
DE
한국어EnglishDeutschEspañolFrançaisItalianoPortuguês (Brasil)日本語简体中文繁體中文
Anmelden
Anmelden
TASTEDEV

Von kleinen Werkzeugen zu besserer Entwicklung.

support@tastedev.netTASTEDEV unterstützen
ProdukteProduktübersichtKaufenDokuDownloadsMarktplatzSupport
CommunityProjekteEntwicklungslogsPromptsProbleme mit KI-ToolsShowcase
RichtlinienÜber unsDatenschutzerklärungNutzungsbedingungenAbo-BedingungenRückerstattungCommunity-Richtlinien
KontoAnmeldenRegistrieren
Besucher
Heute
Gestern
Aufrufe gesamt
Firma
GXSOFT
Vertretungsberechtigt
CHOI YOUNG GU
Handelsregisternummer
853-44-00368
Anschrift
9F V24, 351 Gyeongin-ro, Michuhol-gu, Incheon, Republic of Korea
Telefon
+82-10-4404-1523
E-Mail
whitecalvin@tastedev.net
Datenschutzbeauftragter
CHOI YOUNG GU

© 2026 TASTEDEVProduktinformationen basieren auf verifizierten Entwicklungsquellen.Veröffentlicht · wird verbessert

Grundlegende Datenstrukturen-Dokumentation
Grundlegende Datenstrukturen
Core ConceptsHow It WorksImplementationComplexity AnalysisPractice ProblemsReal-World Use
Diskussionen

Grundlegende Datenstrukturen-Anleitung · 2/6

How It Works

Dieses Kapitel ist vorerst nur auf Englisch verfügbar.

This chapter traces each structure on a tiny example, so you can see exactly which memory moves on every operation.

A dynamic array growing

A dynamic array keeps a size (items in use) and a capacity (slots allocated). When size == capacity and you append, it allocates a block twice as large, copies the old items over and then writes the new one. Here is a trace of nine appends starting from capacity 1:

AppendSize afterCapacity afterItems copied
1110
2221
3342
4440
5584
6 to 8880
99168

Nine appends caused 1 + 2 + 4 + 8 = 15 copies, fewer than two per append. That is why appending is O(1) amortized even though a single append can cost O(n). The simulation below counts copies for any number of appends:

def count_copies(n, growth=2):
    size, capacity, copies = 0, 1, 0
    for _ in range(n):
        if size == capacity:
            copies += size            # move every item to the new block
            capacity *= growth
        size += 1
    return copies

for n in (9, 1_000, 1_000_000):
    print(n, count_copies(n), round(count_copies(n) / n, 2))
# the copies-per-append ratio stays below 2

Inserting at the front is different: every existing item shifts one slot to the right, so list.insert(0, x) costs O(n) every time, not just occasionally.

A linked list splice

A singly linked list A -> B -> D stores three nodes, each with a next reference. To insert C after B:

  1. Create node C.
  2. Set C.next = B.next (so C points to D).
  3. Set B.next = C.

Only two references change, regardless of the list length. The order of steps 2 and 3 matters: doing step 3 first loses the only reference to D. Finding B in the first place still requires walking from the head, which is O(n).

A stack checking brackets

A stack is the natural tool for anything nested. To check that is balanced, push every opening bracket and, on every closing bracket, pop and compare:

Fragen zu diesem Kapitel?
Vorheriges KapitelCore ConceptsNächstes KapitelImplementation
([]{})
CharActionStack after
(push(
[push( [
]pop [, matches(
{push( {
}pop {, matches(
)pop (, matchesempty

The input is balanced because every pop matched and the stack ended empty.

PAIRS = {")": "(", "]": "[", "}": "{"}

def balanced(text):
    stack = []
    for ch in text:
        if ch in "([{":
            stack.append(ch)
        elif ch in PAIRS:
            if not stack or stack.pop() != PAIRS[ch]:
                return False
    return not stack

print(balanced("([]{})"), balanced("(]"), balanced("(("))  # True False False

A queue as a ring buffer

A queue on top of a fixed array uses two indices: head (next item to remove) and tail (next free slot). Both move forward and wrap around with % capacity, so nothing is ever shifted. With capacity 4:

OperationSlotsheadtailSize
start_ _ _ _000
enqueue a, b, ca b c _033
dequeue (a)_ b c _132
enqueue d_ b c d103
enqueue ee b c d114

After e the tail wrapped to slot 0. When the buffer is full, a growable version copies the items into a larger array in queue order and resets head to 0.

A hash table with separate chaining

A hash table has an array of buckets. To store a key, compute hash(key) % bucket_count and put the pair in that bucket. With separate chaining, each bucket is a small list, and keys that collide simply share it. Using 8 buckets and integer keys whose hash is the key itself:

Keykey mod 8Bucket after insert
33bucket 3: [3]
113bucket 3: [3, 11]
66bucket 6: [6]
193bucket 3: [3, 11, 19]

Keys 3, 11 and 19 collide. Looking up 19 hashes to bucket 3 and then scans three entries. The load factor is 4 / 8 = 0.5. When it passes a threshold such as 0.75, the table doubles its bucket count and reinserts every pair, because each pair's bucket index depends on the bucket count.

def place(keys, bucket_count):
    buckets = [[] for _ in range(bucket_count)]
    for key in keys:
        buckets[hash(key) % bucket_count].append(key)
    return {i: b for i, b in enumerate(buckets) if b}

keys = [3, 11, 6, 19]
print(place(keys, 8))   # {3: [3, 11, 19], 6: [6]}
print(place(keys, 16))  # {3: [3, 19], 6: [6], 11: [11]}

Doubling to 16 buckets split the long chain. A good hash function plus a bounded load factor keeps chains short, which is where the average O(1) comes from.

Summary

A dynamic array pays for occasional copying with cheap appends, a linked list changes a couple of references per splice, a stack and a ring-buffer queue only touch their ends, and a hash table computes a bucket and scans a short chain. Tracing these on paper once makes their complexity numbers obvious instead of memorised.

0 Kommentare

Top-KommentareNeueste zuerst

Anmelden · Melde dich an, um einen Kommentar zu schreiben.