--- id: java-linkedlist title: "Java LinkedList" category: "Programming_Language" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["์ž๋ฐ” LinkedList"] duplicate_of: "" source_trust_level: "B" confidence_score: 0.9 created_at: 2026-07-04 updated_at: 2026-07-04 review_reason: "" merge_history: [] tags: ["java", "programming", "w3schools", "collections-framework", "linkedlist"] raw_sources: ["https://www.w3schools.com/java/java_linkedlist.asp"] applied_in: [] github_commit: "" --- # [[Java LinkedList]] ## ๐ŸŽฏ ํ•œ ์ค„ ํ†ต์ฐฐ (One-line insight) ArrayList and LinkedList share the exact same List-interface methods (add/remove/set/clear) but have fundamentally different internal storage โ€” ArrayList uses a real array that gets reallocated/copied when full, while LinkedList uses independently-linked "containers," which is why LinkedList is recommended for manipulation (insert/remove) while ArrayList wins for random access. [S1] ## ๐Ÿง  ํ•ต์‹ฌ ๊ฐœ๋… (Core concepts) - **`LinkedList`** โ€” nearly identical API to ArrayList; both implement `List`. [S1] - **Internal difference: array vs. containers** โ€” ArrayList grows by copying into a new larger array; LinkedList links independent containers together. [S1] - **Use-case split** โ€” ArrayList for storing/accessing data (random access); LinkedList for manipulating data (frequent insert/remove). [S1] - **LinkedList-specific methods** โ€” `addFirst()`, `addLast()`, `removeFirst()`, `removeLast()`, `getFirst()`, `getLast()`. [S1] - **`var` keyword and List-typed variables** โ€” same patterns as ArrayList (`var cars = new LinkedList();`, `List cars = new LinkedList<>();`). [S1] ## ๐Ÿ“– ์„ธ๋ถ€ ๋‚ด์šฉ (Details) - Basic creation: `LinkedList cars = new LinkedList(); cars.add("Volvo"); cars.add("BMW");`. [S1] - Container-based internal structure: each container links to the next; adding an element creates a new container linked into the chain (contrasted with ArrayList's array-copy growth). [S1] - LinkedList-specific methods: `addFirst()`, `addLast()`, `removeFirst()`, `removeLast()`, `getFirst()`, `getLast()`. [S1] ## โš–๏ธ ๋ชจ์ˆœ ๋ฐ ์—…๋ฐ์ดํŠธ (Contradictions & updates) - **ํšจ์œจ์„ฑ ํŠธ๋ ˆ์ด๋“œ์˜คํ”„**: ๋ฌด์ž‘์œ„ ์ ‘๊ทผ์ด ์žฆ์œผ๋ฉด ArrayList๊ฐ€ ๋” ํšจ์œจ์ ์ด์ง€๋งŒ, ํŠน์ • ์‚ฝ์ž…/์‚ญ์ œ ์—ฐ์‚ฐ์€ LinkedList ์ „์šฉ ๋ฉ”์„œ๋“œ๊ฐ€ ๋” ํšจ์œจ์ ์ด๋ผ๋Š” ์ ์ด ๋ช…์‹œ๋จ. [S1] ## ๐Ÿ› ๏ธ ์ ์šฉ ์‚ฌ๋ก€ (Applied in summary) ํ˜„์žฌ ๋ฐœ๊ฒฌ๋œ ์‹ค์ œ ์ ์šฉ ์‚ฌ๋ก€๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค โ€” ๋ฐ์ดํ„ฐ ์ ‘๊ทผ์ด ๋ชฉ์ ์ด๋ฉด ArrayList, ๋ฐ์ดํ„ฐ ์กฐ์ž‘(์‚ฝ์ž…/์‚ญ์ œ)์ด ๋ชฉ์ ์ด๋ฉด LinkedList๋ฅผ ์„ ํƒํ•˜๋Š” ๊ฒƒ์ด ์‹ค์ „ ๊ฐ€์ด๋“œ๋‹ค. [S1] ## ๐Ÿ’ป ์ฝ”๋“œ ํŒจํ„ด (Code patterns) LinkedList-specific first/last methods (Java): ```java LinkedList cars = new LinkedList(); cars.add("Volvo"); cars.addFirst("Mazda"); // add to the beginning cars.addLast("BMW"); // add to the end ``` ## โœ… ๊ฒ€์ฆ ์ƒํƒœ ๋ฐ ์‹ ๋ขฐ๋„ - **์ƒํƒœ:** draft - **๊ฒ€์ฆ ๋‹จ๊ณ„:** conceptual - **์ถœ์ฒ˜ ์‹ ๋ขฐ๋„:** B (W3Schools โ€” widely used educational reference, not a primary standards body) - **์‹ ๋ขฐ ์ ์ˆ˜:** 0.90 - **์ค‘๋ณต ๊ฒ€์‚ฌ ๊ฒฐ๊ณผ:** ์‹ ๊ทœ ์ƒ์„ฑ (New discovery) ## ๐Ÿ”— ์ง€์‹ ๊ทธ๋ž˜ํ”„ (Knowledge Graph) - **์ƒ์œ„/๋ฃจํŠธ:** [[Java Tutorial]] - **๊ด€๋ จ ๊ฐœ๋…:** [[Java ArrayList]], [[Java List]], [[Java Sort List]] - **์ฐธ์กฐ ๋งฅ๋ฝ:** ArrayList์˜ ๋Œ€์•ˆ ๊ตฌํ˜„์ฒด โ€” ์ •๋ ฌ(Sort List) ์ฑ•ํ„ฐ๋กœ ์ด์–ด์ง. ## ๐Ÿ“š ์ถœ์ฒ˜ (Sources) - [S1] W3Schools โ€” Java LinkedList โ€” https://www.w3schools.com/java/java_linkedlist.asp ## ๐Ÿ“ ๋ณ€๊ฒฝ ์ด๋ ฅ (Change history) - 2026-07-04: Initial draft synthesized from the W3Schools "Java LinkedList" page (Astra wiki-curation, P-Reinforce v3.1 format).