๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๋ถ„๋ฅ˜ ์ „์ฒด๋ณด๊ธฐ199

[ALGO] ๋ฐ˜ํ™˜ํ˜•์„ ๋ช…ํ™•ํžˆ ํ•˜์ž ๋ฌธ์ œ https://www.acmicpc.net/problem/10026 10026๋ฒˆ: ์ ๋ก์ƒ‰์•ฝ ์ ๋ก์ƒ‰์•ฝ์€ ๋นจ๊ฐ„์ƒ‰๊ณผ ์ดˆ๋ก์ƒ‰์˜ ์ฐจ์ด๋ฅผ ๊ฑฐ์˜ ๋Š๋ผ์ง€ ๋ชปํ•œ๋‹ค. ๋”ฐ๋ผ์„œ, ์ ๋ก์ƒ‰์•ฝ์ธ ์‚ฌ๋žŒ์ด ๋ณด๋Š” ๊ทธ๋ฆผ์€ ์•„๋‹Œ ์‚ฌ๋žŒ์ด ๋ณด๋Š” ๊ทธ๋ฆผ๊ณผ๋Š” ์ข€ ๋‹ค๋ฅผ ์ˆ˜ ์žˆ๋‹ค. ํฌ๊ธฐ๊ฐ€ N×N์ธ ๊ทธ๋ฆฌ๋“œ์˜ ๊ฐ ์นธ์— R(๋นจ๊ฐ•), G(์ดˆ๋ก) www.acmicpc.net ๋‚˜์˜ ์‚ฝ์งˆ ์ž๊พธ ๋งž๋Š” ์ฝ”๋“œ์ธ๋ฐ ์ด์ƒํ•˜๊ฒŒ ํ์—์„œ (0, 0)์ด ๋ฌดํ•œ์ •์œผ๋กœ ์ƒ์„ฑ๋ผ์„œ ๋ฉ”๋ชจ๋ฆฌ ์ดˆ๊ณผ๊ฐ€ ๋‚ฌ๋‹ค 1) ์ธ์ž๋กœ char color๋ฅผ ๋„˜๊ธฐ๊ณ  board[nx][ny] != color๋กœ ๋น„๊ตํ•ด์„œ ๊ทธ๋Ÿฐ๊ฐ€ ๊ณ ๋ฏผ 2) const int MAX๋ฅผ ์จ์„œ ๊ทธ๋Ÿฐ๊ฐ€ ๊ณ ๋ฏผ ๊ฒฐ๋ก  ๋‹ค ์“ธ๋ฐ์—†์—ˆ๊ณ  bfs ํ•จ์ˆ˜ ๋ฐ˜ํ™˜ํ˜•์ด void์ธ๋ฐ int๋กœ ํ•ด์„œ ๊ทธ๋Ÿฐ ๊ฑฐ์˜€๋‹ค. ์•„๋‹ˆ ๋ฐ˜ํ™˜ํ˜•์ด int์ธ๋ฐ ์™œ ํ์— ๊ฐ’์ด ๋“ค์–ด๊ฐ€๋Š” .. 2023. 6. 20.
[์šด์˜์ฒด์ œ] 12. Disk Management and Scheduling Disk Structure 1) Logical Block - ๋””์Šคํฌ์˜ ์™ธ๋ถ€์—์„œ ๋ณด๋Š” ๋””์Šคํฌ์˜ ๋‹จ์œ„ ์ •๋ณด ์ €์žฅ ๊ณต๊ฐ„๋“ค - ์ฃผ์†Œ๋ฅผ ๊ฐ€์ง„ 1์ฐจ์› ๋ฐฐ์—ด์ฒ˜๋Ÿผ ์ทจ๊ธ‰ - ์ •๋ณด๋ฅผ ์ „์†กํ•˜๋Š” ์ตœ์†Œ ๋‹จ์œ„ 2) Sector - Logical Block์ด ๋ฌผ๋ฆฌ์ ์ธ ๋””์Šคํฌ์— ๋งคํ•‘๋œ ์œ„์น˜ - Sector 0์€ ์ตœ์™ธ๊ณฝ ์‹ค๋ฆฐ๋”์˜ ์ฒซ ํŠธ๋ž™์— ์žˆ๋Š” ์ฒซ ๋ฒˆ์งธ ์„นํ„ฐ์ด๋‹ค (Booting๊ณผ ๊ด€๋ จ๋จ) Disk Management 1) Physical formatting (Low-level formatting) header, trailer์— metadata ์ €์žฅ - ๋””์Šคํฌ๋ฅผ ์ปจํŠธ๋กค๋Ÿฌ๊ฐ€ ์ฝ๊ณ  ์“ธ ์ˆ˜ ์žˆ๋„๋ก ์„นํ„ฐ๋“ค๋กœ ๋‚˜๋ˆ„๋Š” ๊ณผ์ • (์š”์ฆ˜์€ ๋ฏธ๋ฆฌ formatting๋˜์–ด ๋‚˜์˜จ๋‹ค) - ๊ฐ ์„นํ„ฐ๋Š” header + ์‹ค์ œ data(512B) + trailer๋กœ ๊ตฌ.. 2023. 1. 29.
[์šด์˜์ฒด์ œ] 11. File System Implementation [์ด๋ก ] Allocation of File Data in Disk disk์— ํŒŒ์ผ์„ ์ €์žฅํ•  ๋•Œ๋Š” ๋™์ผํ•œ ํฌ๊ธฐ์˜ sector(logical block)๋กœ ๋‚˜๋ˆ„์–ด์„œ ์ €์žฅ 1) contiguous allocation 2) linked allocation 3) indexed allocation 1) Contiguous allocation ํ•˜๋‚˜์˜ file์ด disk ์ƒ์— ์—ฐ์†ํ•ด์„œ ์ €์žฅ๋˜๋Š” ๋ฐฉ๋ฒ• * ์žฅ์  1) ๋น ๋ฅธ I/O - HDD๋Š” disk head์˜ ์ด๋™ ์‹œ๊ฐ„์ด ๊ธด ํŽธ์ธ๋ฐ, ์—ฐ์† ํ• ๋‹น์„ ์“ฐ๋ฉด ํ•œ ๋ฒˆ์˜ seek/rotation์œผ๋กœ ๋งŽ์€ ์–‘์˜ data transfer ๊ฐ€๋Šฅ - process์˜ swap area๋กœ๋„ ์“ฐ์ž„ (์ž„์‹œ ์ €์žฅ์ด๊ธฐ ๋•Œ๋ฌธ์— ๊ณต๊ฐ„ ํšจ์œจ์„ฑ๋ณด๋‹ค๋Š” ์†๋„ ํšจ์œจ์„ฑ์ด ์ข‹์Œ) - real time file์šฉ์œผ๋กœ.. 2023. 1. 22.
[์šด์˜์ฒด์ œ] 10. File Systems File and File System 1) File - ์ด๋ฆ„์„ ํ†ตํ•ด ์ €์žฅํ•˜๋Š” collection : a named collection of related information - ๋น„ํœ˜๋ฐœ์„ฑ์˜ ๋ณด์กฐ๊ธฐ์–ต์žฅ์น˜์— ์ €์žฅ - ๋™์ผํ•œ ๋…ผ๋ฆฌ์  ๋‹จ์œ„๋กœ๋„ ์‚ฌ์šฉ๋จ (device special file) - create, read, write, reposition(lseek - ์–ด๋””๊นŒ์ง€ ์ฝ์—ˆ๋Š”์ง€ ํ‘œ์‹œํ•˜๋Š” ํฌ์ธํ„ฐ), delete, open, close * open : file์˜ ๋‚ด์šฉ์ด ์•„๋‹Œ metadata๋ฅผ disk์— ์˜ฌ๋ ค๋†“๋Š” ๊ฒƒ 2) File attribute(metadata) ํŒŒ์ผ์„ ๊ด€๋ฆฌํ•˜๊ธฐ ์œ„ํ•œ ๊ฐ์ข… ์ •๋ณด๋“ค - ํŒŒ์ผ ์ด๋ฆ„, ์œ ํ˜•, ์ €์žฅ๋œ ์œ„์น˜, ํŒŒ์ผ ์‚ฌ์ด์ฆˆ - ์ ‘๊ทผ ๊ถŒํ•œ(r/w/x), ์‹œ๊ฐ„(์ƒ์„ฑ, ๋ณ€๊ฒฝ, ์‚ฌ์šฉ), ์†Œ์œ ์ž ๋“ฑ.. 2023. 1. 22.