e9cbf23ab5
이전 재구성 작업에서 Dev/ 폴더가 누락되었던 것을 반영. - Dev/Topic_Programming(중첩 폴더, 78개)은 Dev 자체 최상위 폴더들 (Architecture/Conventions/Engineering_Intelligence 등)과 완전 중복이라 제거. - Dev 최상위 엔지니어링 지식 폴더(Architecture/Conventions/Engineering_Intelligence/ Failure_Library/Generalized_Principles/Language/Pattern_Catalog/Platform_Guides/ Subsystems, 77개)는 이미 Topic_Programming/Topic_Programming에 더 최신 버전이 존재해 중복 제거(고유 콘텐츠 1개는 예외 처리하여 이동 보존). - Dev의 W3Schools 언어 튜토리얼 폴더(Topic_C/CPP/CSS/CSharp/HOWTO/HTML/Java/ JavaScript/PHP/Python/SQL/W3CSS, 1201개)는 전부 Topic_Programming 하위로 이동. - 에이전트 운영 상태(.astra/docs)는 그대로 유지, 콘텐츠 폴더만 정리. - Topic_Programming 최종 문서 수: 2784 → 3985.
4.5 KiB
4.5 KiB
id, title, category, status, verification_status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, created_at, updated_at, review_reason, merge_history, tags, raw_sources, applied_in, github_commit
| id | title | category | status | verification_status | canonical_id | aliases | duplicate_of | source_trust_level | confidence_score | created_at | updated_at | review_reason | merge_history | tags | raw_sources | applied_in | github_commit | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| cpp-data-structures | C++ Data Structures and STL | Programming_Language | draft | conceptual |
|
B | 0.87 | 2026-07-04 | 2026-07-04 |
|
|
CPP Data Structures
🎯 한 줄 통찰 (One-line insight)
C has exactly ONE built-in data structure — the array — and everything else (linked lists, stacks, queues, hash-like maps) must be hand-built from structs and raw pointers; C++'s STL instead ships vector/list/stack/queue/deque/set/map as ready-made template classes, meaning the entire "how do I build a linked list" problem that consumed a whole chapter of Topic_C's Pointers section is simply gone from the C++ mental model — replaced by "which header do I include." [S1]
🧠 핵심 개념 (Core concepts)
- STL (Standard Template Library) — a library of data structures + algorithms bundled with C++, used to store and manipulate data efficiently. [S1]
- Containers — data structures that store data (vector, list, stack, queue, deque, set, map). [S1]
- Iterators — objects used to access elements of a container without knowing its internal layout. [S1]
- Algorithms — functions like
sort()andfind()that operate on containers through iterators. [S1] - One header per container — each container requires its own
#include(<vector>,<list>,<set>,<map>,<stack>,<queue>), unlike arrays which need no header. [S1] - Choosing a container is a design decision — the right data structure + algorithm makes a program run faster, especially at scale; the table of 7 containers (Vector/List/Stack/Queue/Deque/Set/Map) each optimize a different access pattern. [S1]
📖 세부 내용 (Details)
- Container comparison table: Vector (array-like, dynamic size, index access), List (sequential, add/remove both ends, no index access), Stack (LIFO, top only), Queue (FIFO, front/back only), Deque (double-ended, index access), Set (unique elements, no index), Map (key/value pairs, access by key). [S1]
- Minimal vector usage:
vector<string> cars = {"Volvo", "BMW", "Ford", "Mazda"}; for (string car : cars) { cout << car << "\n"; }. [S1] - Containers + iterators + algorithms form a triangle: a container without an algorithm to search/manipulate it is not very useful, and an algorithm needs a container to operate on. [S1]
⚖️ 모순 및 업데이트 (Contradictions & updates)
- C에는 없는 개념 층위가 통째로 추가됨: Topic_C에는 "자료구조 챕터"가 존재하지 않았고(배열이 유일한 내장 자료구조), 연결 리스트/스택/큐는 포인터+구조체로 직접 구현하는 예제들이 Pointers 섹션에 흩어져 있었다. C++는 이를 컨테이너+반복자+알고리즘이라는 3층 구조로 라이브러리화했다는 점이 이번 챕터에서 명확히 드러남. [S1]
🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 문자열 vector를 만들고 for-each로 순회하는 패턴이 원문에서 STL 소개 예제로 제시됨. [S1]
💻 코드 패턴 (Code patterns)
Required headers per container, and a first vector example (C++):
#include <vector>
#include <list>
#include <set>
#include <map>
#include <stack>
#include <queue>
vector<string> cars = {"Volvo", "BMW", "Ford", "Mazda"};
for (string car : cars) {
cout << car << "\n";
}
✅ 검증 상태 및 신뢰도
- 상태: draft
- 검증 단계: conceptual
- 출처 신뢰도: B (W3Schools — widely used educational reference, not a primary standards body)
- 신뢰 점수: 0.87
- 중복 검사 결과: 신규 생성 (New discovery)
🔗 지식 그래프 (Knowledge Graph)
- 상위/루트: C++ Tutorial
- 관련 개념: CPP Vectors, CPP List, CPP Stacks, CPP Queues, CPP Arrays
- 참조 맥락: 데이터 구조(STL) 섹션의 도입 챕터 — Vectors로 이어짐.
📚 출처 (Sources)
- [S1] W3Schools — C++ Data Structures and STL — https://www.w3schools.com/cpp/cpp_data_structures.asp
📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "C++ Data Structures and STL" page (Astra wiki-curation, P-Reinforce v3.1 format).