Notice
Recent Posts
Recent Comments
Today
Total
01-26 19:30
Link
๊ด€๋ฆฌ ๋ฉ”๋‰ด

๋ชฉ๋ก๐Ÿ”ฅ Algorithm || ๋ฌธ์ œํ’€์ด/PS (109)

Partially Committed

[c++]Associate container

ํ•™๋ถ€์ƒ์ด ๊ณต๋ถ€ ๊ธฐ๋ก ์ฐจ์›์—์„œ ์ž‘์„ฑํ•œ ๊ธ€์ž…๋‹ˆ๋‹ค. ์–ธ์ œ๋‚˜ ์ง€์ ์€ ํ™˜์˜์ž…๋‹ˆ๋‹ค. Associate container key - value ๋ฅผ ํ†ตํ•ด์„œ ์„œ๋กœ ๊ด€๊ณ„์žˆ๋Š” ๊ฐ’์„ ๋ฌถ์–ด ์ €์žฅํ•˜๋Š” ์ปจํ…Œ์ด๋„ˆ๋ฅผ ๋งํ•œ๋‹ค. key ๊ฐ’์„ ํ†ตํ•ด์„œ ๊ฐ๊ฐ์˜ record ์— ๋น ๋ฅด๊ฒŒ ์ ‘๊ทผ์ด ๊ฐ€๋Šฅํ•˜์ง€๋งŒ specific ํ•œ rule ์— ์˜ํ•ด sorting ๋˜๊ธฐ ๋•Œ๋ฌธ์— insert ํ•  key ๊ฐ’์˜ ์œ„์น˜๋ฅผ ์ง€์ •ํ•  ์ˆ˜ ์—†๋‹ค. balanced binary search tree ๋‚˜ hash function ์„ ์‚ฌ์šฉํ•˜์—ฌ ๊ตฌํ˜„๋œ๋‹ค๊ณ  ํ•œ๋‹ค. std::set balanced binary tree ๋กœ ๊ตฌํ˜„๋˜์–ด ์žˆ๋Š” ์ •๋ ฌ๋œ ์ง‘ํ•ฉ์„ ํฌํ•จํ•˜๋Š” associate container ์ด๋‹ค. ์ค‘๋ณต๋˜๋Š” ์š”์†Œ๋ฅผ ํ—ˆ์šฉํ•˜์ง€ ์•Š๋Š”๋‹ค. ์˜ค๋ฆ„์ฐจ์ˆœ์œผ๋กœ ์ •๋ ฌ๋œ ์œ„์น˜์— ์›์†Œ๋ฅผ ์‚ฝ์ž…ํ•˜๊ธฐ ๋•Œ๋ฌธ์— ..