Algorithms 알고리즘

4.1 Introduction

알고리즘은 input을 받고 일련의 과정을 거쳐 output을 반환하는 것이다.

알고리즘은 pseudocode(not an actual code)로 표현된다.

🎯 Finding the max of three numbers

image.png

🎯 Finding the max in a sequence

image.png

🎯 Determine whether n is prime(소수)

image.png

🎯 Find the second largest number among three numbers

image.png

4.2 Examples of Algorithms

🎯 Sort 13, 5, 8, 11, 20, 6

image.png

image.png

📌 Insertion Sort의 알고리즘

image.png

image.png