๐Ÿ“‚ Data Structure

[์ž๋ฃŒ๊ตฌ์กฐ] ์•Œ๊ณ ๋ฆฌ์ฆ˜์˜ ์ •์˜

dhyuck 2021. 6. 2. 21:30
๋ฐ˜์‘ํ˜•

An algorithm is a finite set of instructions that, if followed, accomplishes a particular task.
์•Œ๊ณ ๋ฆฌ์ฆ˜์€ ๋‹ค์Œ ์กฐ๊ฑด์„ ๋งŒ์กฑํ•˜๋Š” ํŠน์ •ํ•œ ์ž‘์—…(particular task)์„ ์ˆ˜ํ–‰ํ•˜๋Š” ์œ ํ•œํ•œ ๋ช…๋ น์–ด์˜ ์ง‘ํ•ฉ(a finite set of instructions)์ด๋‹ค.

  1. Input(์ž…๋ ฅ) : ์™ธ๋ถ€์—์„œ ์ž…๋ ฅ์ด 0๊ฐœ ์ด์ƒ์ด์–ด์•ผ ํ•œ๋‹ค.
  2. Output(์ถœ๋ ฅ) : ์ถœ๋ ฅ์ด 1๊ฐœ ์ด์ƒ์ด์–ด์•ผ ํ•œ๋‹ค.
  3. Definiteness(๋ช…ํ™•์„ฑ) : ๊ฐ๊ฐ์˜ ๋ช…๋ น์–ด๋Š” ๋ช…ํ™•(clear)ํ•˜๊ณ  ๋ชจํ˜ธ(unambiguous)ํ•˜์ง€ ์•Š์•„์•ผํ•œ๋‹ค.
  4. Finiteness(์œ ํ•œ์„ฑ) : ๋ชจ๋“  ๊ฒฝ์šฐ์— ์•Œ๊ณ ๋ฆฌ์ฆ˜์€ ํ•œ์ •๋œ ์Šคํ… ํ›„์— ์ข…๋ฃŒ๋ฉ๋‹ˆ๋‹ค.
  5. Effectivenes(์œ ํšจ์„ฑ) : ๋ชจ๋“  ๋ช…๋ น์€ ์‚ฌ๋žŒ์ด ์—ฐํ•„๊ณผ ์ข…์ด๋งŒ์„ ์‚ฌ์šฉํ•˜์—ฌ ์ˆ˜ํ–‰๋  ์ˆ˜ ์žˆ์„ ๋งŒํผ ์ถฉ๋ถ„ํžˆ ๊ธฐ๋ณธ์ ์ด์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
    ์กฐ๊ฑด 3์ฒ˜๋Ÿผ ๊ฐ ๋ช…๋ น์ด ๋ช…ํ™•ํ•œ ๊ฒƒ์œผ๋กœ๋Š” ์ถฉ๋ถ„ํ•˜์ง€ ์•Š๊ณ , ์‹คํ–‰๊ฐ€๋Šฅํ•œ ๋ช…๋ น์ด์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด ๋ชจ๋“  ์ •์ˆ˜๋ฅผ ์ €์žฅํ•˜์—ฌ๋ผ ๊ฐ™์€ ๋ช…๋ น์€ ์‹คํ–‰ ๋ถˆ๊ฐ€๋Šฅํ•œ ๋ช…๋ น์ž…๋‹ˆ๋‹ค.

์ปดํ“จํ„ฐ ๊ณตํ•™์—์„œ Algorithm๊ณผ Program์€ ๋‹ค๋ฅธ ๊ฒƒ์œผ๋กœ ๊ตฌ๋ถ„๋ฉ๋‹ˆ๋‹ค. Program์€ 4๋ฒˆ์งธ ์กฐ๊ฑด์„ ๋งŒ์กฑํ•˜์ง€ ์•Š์•„๋„ ๋ฉ๋‹ˆ๋‹ค.

๋ฐ˜์‘ํ˜•