Algorithm

Heap Sort Implementation

2 minute read

์ฝ”๋“œ ๊ตฌํ˜„ ์›์น™ ์ˆ˜๋„์ฝ”๋“œ๋ณด๊ณ  ๊ตฌํ˜„ ์‹คํŒจ์‹œ, ์ฝ”๋“œ๋ณด๊ณ  ์ฝ”๋ฉ˜ํŠธ ๋‹ฌ๊ณ  ์ž‘์„ฑํ•ด๋ณด๊ธฐ ์žฌ๊ท€๋กœ ๊ตฌํ˜„ ์™„์„ฑ iterative version ๊ตฌํ˜„ํ•˜๊ธฐ

Quick Sort Implementation

1 minute read

Pseudo Code ๊ธฐ์ค€์ (pivot)์„ ์ •ํ•œ๋‹ค. (4๊ฐ€์ง€ ๋ฐฉ๋ฒ• ์กด์žฌ) Always pick first element as pivot. Always pick last element as pivot (implemented below) ...

Bubble Sort Implementation

less than 1 minute read

Pseudo Code adjacent elements ๋ผ๋ฆฌ ๋น„๊ตํ•œ๋‹ค. ์–ด๋–ป๊ฒŒ sorted๊ฐ€ ๋˜์—ˆ๋Š”์ง€ ํŒ๋‹จํ•˜๋Š”๊ฐ€(์ข…๋ฃŒ์กฐ๊ฑด) 2-1. ์ฒซ pass๋ฅผ ํ†ต๊ณผํ•˜๋ฉด ๋งˆ์ง€๋ง‰ ์›์†Œ๋Š” ๋ฌด์กฐ๊ฑด ๊ฐ€์žฅ ํฐ ์›์†Œ๊ฐ€ ๋จ 2-2. ๋”ฐ๋ผ์„œ pass ํ•  ๋•Œ๋งˆ๋‹ค ๋’ค์—์„œ๋ถ€ํ„ฐ ์ •๋ ฌ์ด ๋˜๋Š” ์•Œ๊ณ ๋ฆฌ์ฆ˜ 2-...

N Queen

1 minute read

Backtracking ๋Œ€ํ‘œ ๋ฌธ์ œ Backtracking ๋Œ€ํ‘œ์  ๋ฌธ์ œ๋ผ๊ณ  ํ•œ๋‹ค.