SlideShare a Scribd company logo
1 of 12
An introduction to
computer
Science
- Algorithm
2017. 04. 11
황태욱
01 File System
02 Main Memory Management
CONTENTS
03 Further Study
1.1 Algorithm
수학자이자 바그다드 왕립 의회 의원이었던 Mohammed Al Khwarizmi 이름에서
유래된 것으로 문제를 해결하기 위해 구성된 일련의 순서화된 절차
• 0개 이상의 입력과 1개 이상의 출력이 있어야 한다
• 종료되어야 한다
• 모든 명령이 실행 가능해야 한다
다음의 기초적인 알고리즘에 대해 살펴본다
정렬 알고리즘: Sort
탐색 알고리즘: Search
재귀 알고리즘:
2.1 Sort Algorithm
정렬(Sort)란 데이터를 규칙에 따라 재배열하는 것
정렬하는 것을 Sorting이라고 함
예: 15 11 1 3 8
오름차순 정렬
1 3 8 11 15
내림차순 정렬
15 11 8 3 1
2.2 Sort Algorithm
선택 정렬: Selection Sort
인간이 하는 정렬 방식과 유사
- 가장 적은 수부터 찾아서 맨 앞에 항목부터 교체 하는 방식
삽입정렬: Insertion sort
- 정렬되지 않은 임의의 데이터를 이미 정렬된 부분의 적절한 위치에 삽입
버블정렬: Bubble sort
- 서로 이웃한 데이터들을 비교하여 가장 큰 데이터를 가장 뒤로 보내며 정렬
3.1 Search Algorithm
탐색(Search)은 특정 데이터를 찾는 것
아동 명부에서 “개나리”아동을 찾는 것
운동장에서 놀고 있는 “민들레”아동을 찾는 것 모두 검색
- 정렬된 데이터에서 찾는 것
- 정렬되지 않은 데이터에서 찾는 것
1. 선형탐색 : Linear search / Sequential search
2. 이진 탐색 : Binary search
4.1 Recursive Algorithm
자신을 호출하는 것을 재귀 호출이라 하고 이를 이용하는 알고리즘을
재귀 알고리즘 이라고 한다
N까지 합을 구하는 재귀 알고리즘
n까지의 합
= 1 (n=1)
= n + (n-1)까지의 합 (n>1)
int sum(int n)
{
if (n == 1)
return 1;
else
return n + sum(n-1);
}
4.2 Recursive Algorithm: Fibonacci
피보나치 수열
어떤 남자가 벽으로 둘러싸인 장소에 한 쌍의 토끼를 둔다. 두 번째 달부터
매달 토끼를 한 쌍 낳는다고 가정한다면 그 해에 얼마나 많은 쌍의 토끼가?
1, 1, 2, 3, 5, 8, 13, 21 …
f(n) = 1 (n<=2 일때)
f(n) = f(n-2)+f(n-1)
int fibo(int n)
{
if (n==1 || n==2)
return 1;
else
return fibo(n-2)+fibo(n-1);
}
4.2 Recursive Algorithm: Hanoi Tower
하노이 탑
void hanoi (int n, char A[], char B[], char C[])
{
if (n==1)
printf (“board %d move %s->s”, n, A, C)
else {
hanoi (n-1, A, C, B);
printf (“board %d move %s->%s”, n, A, C);
hanoi (n-1, B, A, C);
}
}
4.2 Recursive Algorithm: Quick Sort
퀵 소트: Quick Sort
기준키를 기준으로 작거나 같은 값을 지닌 데이터는 앞으로, 큰 값을 지닌
데이터는 뒤로 가도록 하여 작은 값을 갖는 데이터와 큰 값을 갖는 데이터로
분리해 가며 정렬하는 방법
퀵 소트 소스 코드
http://alzi.tistory.com/26
3. Further Study
위키피디아 알고리즘
https://ko.wikipedia.org/wiki/%EC%95%8C%EA%B3%A0%EB%A6%AC%EC
%A6%98
나무위키 알고리즘
https://namu.wiki/w/%EC%95%8C%EA%B3%A0%EB%A6%AC%EC%A6%98
나무위키 정렬알고리즘
https://namu.wiki/w/%EC%A0%95%EB%A0%AC%20%EC%95%8C%EA%B3
%A0%EB%A6%AC%EC%A6%98
Q&A
For further details, please contact us by e-mail
황태욱 : taewook.hwang@gmail.com
010.9576.5105
Kakao: Aldemaya

More Related Content

What's hot

[0119 박민근] 기술 면접시 자주 나오는 문제들(ver 2013)
[0119 박민근] 기술 면접시 자주 나오는 문제들(ver 2013)[0119 박민근] 기술 면접시 자주 나오는 문제들(ver 2013)
[0119 박민근] 기술 면접시 자주 나오는 문제들(ver 2013)
MinGeun Park
 
Chapitre i architecture générale de l’unité centrale d’un ordinateur
Chapitre i architecture générale de l’unité centrale d’un ordinateurChapitre i architecture générale de l’unité centrale d’un ordinateur
Chapitre i architecture générale de l’unité centrale d’un ordinateur
Sana Aroussi
 
Computer organiztion1
Computer organiztion1Computer organiztion1
Computer organiztion1
Umang Gupta
 
les composannt d'un ordinateur
les composannt d'un ordinateurles composannt d'un ordinateur
les composannt d'un ordinateur
boukrab
 
NDC14 - 사례로 배우는 디스어셈블리 디버깅
NDC14 - 사례로 배우는 디스어셈블리 디버깅NDC14 - 사례로 배우는 디스어셈블리 디버깅
NDC14 - 사례로 배우는 디스어셈블리 디버깅
Seungjae Lee
 
홍성우, 게임 서버의 목차 - 시작부터 출시까지, NDC2019
홍성우, 게임 서버의 목차 - 시작부터 출시까지, NDC2019홍성우, 게임 서버의 목차 - 시작부터 출시까지, NDC2019
홍성우, 게임 서버의 목차 - 시작부터 출시까지, NDC2019
devCAT Studio, NEXON
 
3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.ppt3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.ppt
RavikumarR77
 

What's hot (20)

컴퓨터개론03
컴퓨터개론03컴퓨터개론03
컴퓨터개론03
 
[0602 박민근] Direct2D
[0602 박민근] Direct2D[0602 박민근] Direct2D
[0602 박민근] Direct2D
 
[0119 박민근] 기술 면접시 자주 나오는 문제들(ver 2013)
[0119 박민근] 기술 면접시 자주 나오는 문제들(ver 2013)[0119 박민근] 기술 면접시 자주 나오는 문제들(ver 2013)
[0119 박민근] 기술 면접시 자주 나오는 문제들(ver 2013)
 
Chapitre i architecture générale de l’unité centrale d’un ordinateur
Chapitre i architecture générale de l’unité centrale d’un ordinateurChapitre i architecture générale de l’unité centrale d’un ordinateur
Chapitre i architecture générale de l’unité centrale d’un ordinateur
 
충돌 알고리즘(collision detection algorithms)
충돌 알고리즘(collision detection algorithms)충돌 알고리즘(collision detection algorithms)
충돌 알고리즘(collision detection algorithms)
 
Computer organiztion1
Computer organiztion1Computer organiztion1
Computer organiztion1
 
2nd PUC computer science chapter 2 boolean algebra 1
2nd PUC computer science chapter 2  boolean algebra 12nd PUC computer science chapter 2  boolean algebra 1
2nd PUC computer science chapter 2 boolean algebra 1
 
Chap7 simulation numérique
Chap7 simulation numériqueChap7 simulation numérique
Chap7 simulation numérique
 
系統程式 -- 第 1 章
系統程式 -- 第 1 章系統程式 -- 第 1 章
系統程式 -- 第 1 章
 
Exercice3 - Logiciels
Exercice3 - LogicielsExercice3 - Logiciels
Exercice3 - Logiciels
 
les composannt d'un ordinateur
les composannt d'un ordinateurles composannt d'un ordinateur
les composannt d'un ordinateur
 
게임서버프로그래밍 #1 - IOCP
게임서버프로그래밍 #1 - IOCP게임서버프로그래밍 #1 - IOCP
게임서버프로그래밍 #1 - IOCP
 
NDC14 - 사례로 배우는 디스어셈블리 디버깅
NDC14 - 사례로 배우는 디스어셈블리 디버깅NDC14 - 사례로 배우는 디스어셈블리 디버깅
NDC14 - 사례로 배우는 디스어셈블리 디버깅
 
Développement informatique : Algorithmique I : Récursion et arbre
Développement informatique : Algorithmique I : Récursion et arbreDéveloppement informatique : Algorithmique I : Récursion et arbre
Développement informatique : Algorithmique I : Récursion et arbre
 
홍성우, 게임 서버의 목차 - 시작부터 출시까지, NDC2019
홍성우, 게임 서버의 목차 - 시작부터 출시까지, NDC2019홍성우, 게임 서버의 목차 - 시작부터 출시까지, NDC2019
홍성우, 게임 서버의 목차 - 시작부터 출시까지, NDC2019
 
3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.ppt3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.ppt
 
Travaux dirigés 1: algorithme & structures de données
Travaux dirigés 1: algorithme & structures de donnéesTravaux dirigés 1: algorithme & structures de données
Travaux dirigés 1: algorithme & structures de données
 
ICDL MODULE 1 Lesson 2
ICDL MODULE 1 Lesson 2ICDL MODULE 1 Lesson 2
ICDL MODULE 1 Lesson 2
 
Program execution
Program executionProgram execution
Program execution
 
시즌 2: 멀티쓰레드 프로그래밍이 왜이리 힘드나요?
시즌 2: 멀티쓰레드 프로그래밍이 왜이리 힘드나요?시즌 2: 멀티쓰레드 프로그래밍이 왜이리 힘드나요?
시즌 2: 멀티쓰레드 프로그래밍이 왜이리 힘드나요?
 

Similar to 컴퓨터개론09

머신 러닝을 해보자 1장 (2022년 스터디)
머신 러닝을 해보자 1장 (2022년 스터디)머신 러닝을 해보자 1장 (2022년 스터디)
머신 러닝을 해보자 1장 (2022년 스터디)
ssusercdf17c
 

Similar to 컴퓨터개론09 (9)

동적 계획법 Dynamic Programming
동적 계획법 Dynamic Programming동적 계획법 Dynamic Programming
동적 계획법 Dynamic Programming
 
[Algorithm] Counting Sort
[Algorithm] Counting Sort[Algorithm] Counting Sort
[Algorithm] Counting Sort
 
2.linear regression and logistic regression
2.linear regression and logistic regression2.linear regression and logistic regression
2.linear regression and logistic regression
 
[Algorithm] Binary Search
[Algorithm] Binary Search[Algorithm] Binary Search
[Algorithm] Binary Search
 
알고리즘과 자료구조
알고리즘과 자료구조알고리즘과 자료구조
알고리즘과 자료구조
 
머신 러닝을 해보자 1장 (2022년 스터디)
머신 러닝을 해보자 1장 (2022년 스터디)머신 러닝을 해보자 1장 (2022년 스터디)
머신 러닝을 해보자 1장 (2022년 스터디)
 
sort algorithim
sort algorithimsort algorithim
sort algorithim
 
밑바닥부터시작하는딥러닝 Ch2
밑바닥부터시작하는딥러닝 Ch2밑바닥부터시작하는딥러닝 Ch2
밑바닥부터시작하는딥러닝 Ch2
 
[D2CAMPUS] Algorithm tips - ALGOS
[D2CAMPUS] Algorithm tips - ALGOS[D2CAMPUS] Algorithm tips - ALGOS
[D2CAMPUS] Algorithm tips - ALGOS
 

More from Edward Hwang

기술 창업 Idea to business
기술 창업 Idea to business기술 창업 Idea to business
기술 창업 Idea to business
Edward Hwang
 
Lean startup 이해하기 황태욱
Lean startup 이해하기   황태욱Lean startup 이해하기   황태욱
Lean startup 이해하기 황태욱
Edward Hwang
 

More from Edward Hwang (20)

컴퓨터개론13
컴퓨터개론13컴퓨터개론13
컴퓨터개론13
 
컴퓨터개론12
컴퓨터개론12컴퓨터개론12
컴퓨터개론12
 
컴퓨터개론11
컴퓨터개론11컴퓨터개론11
컴퓨터개론11
 
02 특허와 실용신안 제도
02 특허와 실용신안 제도02 특허와 실용신안 제도
02 특허와 실용신안 제도
 
게임디자인 레벨 밸런싱
게임디자인   레벨 밸런싱게임디자인   레벨 밸런싱
게임디자인 레벨 밸런싱
 
Understanding of growth hacking 01
Understanding of growth hacking 01Understanding of growth hacking 01
Understanding of growth hacking 01
 
Understanding of gamification 03
Understanding of gamification 03Understanding of gamification 03
Understanding of gamification 03
 
게임디자인 게임시스템
게임디자인   게임시스템게임디자인   게임시스템
게임디자인 게임시스템
 
게임디자인 게임디자인
게임디자인   게임디자인게임디자인   게임디자인
게임디자인 게임디자인
 
게임디자인 게임제작 및 시나리오
게임디자인   게임제작 및 시나리오게임디자인   게임제작 및 시나리오
게임디자인 게임제작 및 시나리오
 
게임의 분류
게임의 분류게임의 분류
게임의 분류
 
게임디자인 게임역사
게임디자인   게임역사게임디자인   게임역사
게임디자인 게임역사
 
창업아이디어 2015 2학기
창업아이디어 2015 2학기창업아이디어 2015 2학기
창업아이디어 2015 2학기
 
Understanding of gamification 2015
Understanding of gamification 2015Understanding of gamification 2015
Understanding of gamification 2015
 
사업계획서 기본요소
사업계획서 기본요소사업계획서 기본요소
사업계획서 기본요소
 
May 2015 flow chart 익히기
May 2015 flow chart 익히기May 2015 flow chart 익히기
May 2015 flow chart 익히기
 
창업아이디어
창업아이디어창업아이디어
창업아이디어
 
앱을 위한 아이디어 2015
앱을 위한 아이디어 2015 앱을 위한 아이디어 2015
앱을 위한 아이디어 2015
 
기술 창업 Idea to business
기술 창업 Idea to business기술 창업 Idea to business
기술 창업 Idea to business
 
Lean startup 이해하기 황태욱
Lean startup 이해하기   황태욱Lean startup 이해하기   황태욱
Lean startup 이해하기 황태욱
 

컴퓨터개론09

  • 1. An introduction to computer Science - Algorithm 2017. 04. 11 황태욱
  • 2. 01 File System 02 Main Memory Management CONTENTS 03 Further Study
  • 3. 1.1 Algorithm 수학자이자 바그다드 왕립 의회 의원이었던 Mohammed Al Khwarizmi 이름에서 유래된 것으로 문제를 해결하기 위해 구성된 일련의 순서화된 절차 • 0개 이상의 입력과 1개 이상의 출력이 있어야 한다 • 종료되어야 한다 • 모든 명령이 실행 가능해야 한다 다음의 기초적인 알고리즘에 대해 살펴본다 정렬 알고리즘: Sort 탐색 알고리즘: Search 재귀 알고리즘:
  • 4. 2.1 Sort Algorithm 정렬(Sort)란 데이터를 규칙에 따라 재배열하는 것 정렬하는 것을 Sorting이라고 함 예: 15 11 1 3 8 오름차순 정렬 1 3 8 11 15 내림차순 정렬 15 11 8 3 1
  • 5. 2.2 Sort Algorithm 선택 정렬: Selection Sort 인간이 하는 정렬 방식과 유사 - 가장 적은 수부터 찾아서 맨 앞에 항목부터 교체 하는 방식 삽입정렬: Insertion sort - 정렬되지 않은 임의의 데이터를 이미 정렬된 부분의 적절한 위치에 삽입 버블정렬: Bubble sort - 서로 이웃한 데이터들을 비교하여 가장 큰 데이터를 가장 뒤로 보내며 정렬
  • 6. 3.1 Search Algorithm 탐색(Search)은 특정 데이터를 찾는 것 아동 명부에서 “개나리”아동을 찾는 것 운동장에서 놀고 있는 “민들레”아동을 찾는 것 모두 검색 - 정렬된 데이터에서 찾는 것 - 정렬되지 않은 데이터에서 찾는 것 1. 선형탐색 : Linear search / Sequential search 2. 이진 탐색 : Binary search
  • 7. 4.1 Recursive Algorithm 자신을 호출하는 것을 재귀 호출이라 하고 이를 이용하는 알고리즘을 재귀 알고리즘 이라고 한다 N까지 합을 구하는 재귀 알고리즘 n까지의 합 = 1 (n=1) = n + (n-1)까지의 합 (n>1) int sum(int n) { if (n == 1) return 1; else return n + sum(n-1); }
  • 8. 4.2 Recursive Algorithm: Fibonacci 피보나치 수열 어떤 남자가 벽으로 둘러싸인 장소에 한 쌍의 토끼를 둔다. 두 번째 달부터 매달 토끼를 한 쌍 낳는다고 가정한다면 그 해에 얼마나 많은 쌍의 토끼가? 1, 1, 2, 3, 5, 8, 13, 21 … f(n) = 1 (n<=2 일때) f(n) = f(n-2)+f(n-1) int fibo(int n) { if (n==1 || n==2) return 1; else return fibo(n-2)+fibo(n-1); }
  • 9. 4.2 Recursive Algorithm: Hanoi Tower 하노이 탑 void hanoi (int n, char A[], char B[], char C[]) { if (n==1) printf (“board %d move %s->s”, n, A, C) else { hanoi (n-1, A, C, B); printf (“board %d move %s->%s”, n, A, C); hanoi (n-1, B, A, C); } }
  • 10. 4.2 Recursive Algorithm: Quick Sort 퀵 소트: Quick Sort 기준키를 기준으로 작거나 같은 값을 지닌 데이터는 앞으로, 큰 값을 지닌 데이터는 뒤로 가도록 하여 작은 값을 갖는 데이터와 큰 값을 갖는 데이터로 분리해 가며 정렬하는 방법 퀵 소트 소스 코드 http://alzi.tistory.com/26
  • 11. 3. Further Study 위키피디아 알고리즘 https://ko.wikipedia.org/wiki/%EC%95%8C%EA%B3%A0%EB%A6%AC%EC %A6%98 나무위키 알고리즘 https://namu.wiki/w/%EC%95%8C%EA%B3%A0%EB%A6%AC%EC%A6%98 나무위키 정렬알고리즘 https://namu.wiki/w/%EC%A0%95%EB%A0%AC%20%EC%95%8C%EA%B3 %A0%EB%A6%AC%EC%A6%98
  • 12. Q&A For further details, please contact us by e-mail 황태욱 : taewook.hwang@gmail.com 010.9576.5105 Kakao: Aldemaya