Sorting Algorithm
Implemented and benchmarked 12 sorting algorithms under various input conditions.
๐ฌ Thoughts
What I enjoyed most about the sorting algorithm project was seeing just how many different ways there are to solve what seems like the same problem. Thereโs no โbestโ sorting algorithm โ each one has its strengths depending on the situation, whether itโs input size, distribution, or memory constraints.
It was also fascinating to realize that even something as old and โsolvedโ as sorting is still an active area of research, with ideas like hybrid sorting (e.g. TimSort) used in modern languages like C++ and Python. I used to take built-in sort functions for granted, but now I see the layers of design behind them.
Studying lesser-known algorithms like Library Sort through actual papers was honestly hard โ especially figuring out the rebalancing logic โ but that made it more satisfying. It wasnโt just copy-pasting theory; I had to implement, debug, and understand the weird edge cases on my own.
Also, using Overleaf for the first time felt like writing a real paper โ start to finish, with figures, tables, and everything. That gave me a strong sense of completion, way more than a normal homework writeup.
In the end, this project reminded me that even for problems we โunderstand,โ thereโs still depth left to explore โ and solving them well still takes engineering, not just theory.
๐ฌ ๋๋ ์
์ด๋ฒ ์ ๋ ฌ ์๊ณ ๋ฆฌ์ฆ ํ๋ก์ ํธ์์ ๊ฐ์ฅ ์ฌ๋ฐ์๋ ๊ฑด, ๊ฐ์ ์ ๋ ฌ ๋ฌธ์ ๋ผ๋ ์๊ณ ๋ฆฌ์ฆ์ด ์ ๋ง ๋ค์ํ๋ค๋ ์ ์ด์๋ค. ๋ฌด์กฐ๊ฑด ๋น ๋ฅธ ๊ฒ ์ข์ ๊ฒ ์๋๋ผ, ์ํฉ(๋ฐ์ดํฐ ๋ถํฌ, ๋ฉ๋ชจ๋ฆฌ ์ ์ฝ, ์ ๋ ฅ ํฌ๊ธฐ ๋ฑ)์ ๋ฐ๋ผ ๊ฐ๊ฐ ์ฅ๋จ์ ์ด ๋ค๋ฅด๋ค๋ ๊ฒ ์ ๊ธฐํ๋ค.
๋, ์ ๋ ฌ์ฒ๋ผ ๊ณ ์ ์ ์ด๊ณ โ์ด๋ฏธ ๋ค ์ฐ๊ตฌ๋ ๊ฒ ๊ฐ์ ์ฃผ์ โ์๋ ์์ง๊น์ง ํ์ด๋ธ๋ฆฌ๋ ์๊ณ ๋ฆฌ์ฆ์ฒ๋ผ ์๋ก์ด ์๋๋ค์ด ์ด์ด์ง๊ณ ์๋ค๋ ์ฌ์ค์ด ๋๋ผ์ ๋ค. C++์ด๋ Python ํ์ค ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ๋ค์ด ์๋ TimSort๋ ์ด๋ฒ์ ์ฒ์ ์ ๋๋ก ์๋ฆฌ๋ฅผ ์๊ฒ ๋์๊ณ , ๊ทธ๋์์ ๊ทธ๋ฅ .sort() ์จ๋ ๋น์ฐํ ๊ฑธ๋ก ์๊ฐํ๋๋ฐ, ๊ทธ ์์๋ ์๋ง์ ์ต์ ํ๊ฐ ์๋ค๋ ๊ฑธ ๊นจ๋ฌ์๋ค.
Library Sort ๊ฐ์ด ์ ์๋ ค์ง์ง ์์ ์๊ณ ๋ฆฌ์ฆ์ ๋ ผ๋ฌธ ๋ณด๊ณ ๊ตฌํํ๋ ๊ฒ ์ง์ง ์ด๋ ค์ ๋ค. ๊ฐญ ์ฌ๋ฐฐ์น ๋ก์ง ๊ฐ์ ๊ฑด ๋๋ฒ๊น ํ๋ฉด์ ์ดํดํด์ผ ํ๊ณ , ์ค๊ฐ์ ์๋ชป๋ ๊ตฌํ ๋๋ฌธ์ ์ ํ๋๋ ๋ฎ๊ฒ ๋์์ ์์ฒญ ๊ณ ์ํ๋ค. ๊ทธ๋๋ ๋ด๊ฐ ์ง์ ๋ ผ๋ฌธ ๋ณด๊ณ ๊ตฌํํ๊ณ , ๋ ผ๋ฌธ์ฒ๋ผ ์์ฑํด์ ์ ๋ฆฌํ ๊ณผ์ ์์ฒด๊ฐ ๋ฟ๋ฏํ๋ค.
Overleaf ์ฒ์ ์จ๋ดค๋๋ฐ, ๊ทธ๋ฅ ๊ณผ์ ํ๋ ๋๋์ด ์๋๋ผ ์ง์ง ๋ ผ๋ฌธ ์ฐ๋ ๋๋์ด๋ผ ์์ฑํ๊ณ ๋๋๊น ์ฑ์ทจ๊ฐ๋ ํจ์ฌ ์ปธ๋ค.
์ ๋ ฌ์ด๋ผ๋ ์ต์ํ ๋ฌธ์ ๋ ํ๊ณ ๋ค๋ค ๋ณด๋ฉด ๊ฒฐ๊ตญ ์ด๋ก + ๊ตฌํ + ์ต์ ํ๊ฐ ๋ค ๋ค์ด๊ฐ๋ ์ข ํฉ ๋ฌธ์ ๋ผ๋ ๊ฑธ ๋ค์ ๋๊ผ๋ค. ๋จ์ํ ์ ๋ต๋ง ๊ตฌํ๋ ๊ฒ ์๋๋ผ, ์กฐ๊ฑด์ ๋ฐ๋ผ ์ข์ ์ ํ์ ํ๋ ๊ฒ ์์ฒด๊ฐ ์๊ณ ๋ฆฌ์ฆ ์ค๊ณ๋ผ๋ ๊ฑธ ๋ฐฐ์ด ๊ฒ ๊ฐ๋ค.