SlideShare a Scribd company logo
1 of 20
Copyrightⓒ. Saebyeol Yu. All Rights Reserved.
Copyrightⓒ. Saebyeol Yu. All Rights Reserved.
KOI3125
Copyrightⓒ. Saebyeol Yu. All Rights Reserved.
Contents
 RadixSort
 QuickSort
 시간복잡도
 실제실행시간
001 정렬의소개 002 정렬의실생활예시 003 정렬시간비교 004 GPT와의비교
 GPT작성코드/Handmade코드
 비교와대조
 RadixSort
 QuickSort
Copyrightⓒ. Saebyeol Yu. All Rights Reserved.
001
정렬의 소개
Copyrightⓒ. Saebyeol Yu. All Rights Reserved.
KOI3125
Copyrightⓒ. Saebyeol Yu. All Rights Reserved.
기수 정렬
데이터의 직접적인 비교 없는 정렬!
데이터 직접 비교(a_1 > a_3)
그 대신 자릿수로 비교하는 정렬이 기수 정렬
Copyrightⓒ. Saebyeol Yu. All Rights Reserved.
1
정렬의 소개
Radix Sort
1. X진법에서 0 ~ X – 1번의 리스트를 만든다.
2. 데이터를 현재 자릿수가 가르키는 리스트에 Push 한다.
3. 리스트를 0 ~ X – 1번까지 순서대로 연결한다,
정렬 방법
Copyrightⓒ. Saebyeol Yu. All Rights Reserved.
Copyrightⓒ. Saebyeol Yu. All Rights Reserved.
1
정렬의 소개
Radix Sort 정렬 방법(그림)
Copyrightⓒ. Saebyeol Yu. All Rights Reserved.
퀵 정렬
평균적인 상황에서 최고의 성능을 나타내는 알고리즘.
많은 정렬 구현체에서 사용되는 알고리즘이다.
Copyrightⓒ. Saebyeol Yu. All Rights Reserved.
1
정렬의 소개
Quick Sort
1. 적절한 원소 하나를 기준(피봇, Pivot)으로 잡는다.
2. Pivot보다 작은 원소는 앞으로 빼고, 그 뒤에 Pivot을 옮겨 피벗보
다 작은 것, 큰것으로 나눈다. (Partition Step)
3. 나눠진 원소들에서 다시 피벗을 잡고 정렬하는 과정을 각 크기가
0, 1이 될때까지 정렬한다.
정렬 방법
Copyrightⓒ. Saebyeol Yu. All Rights Reserved.
Copyrightⓒ. Saebyeol Yu. All Rights Reserved.
1
정렬의 소개
Quick Sort 정렬 방법(그림)
Pivot을 잡는 방식에는 여러 방법이 있다.
1. 맨 왼, 오른쪽을 잡는 방법
2. 랜덤한 원소를 잡는 방법
3. 3가지 값의 중앙값을 잡는 방법
다양한 Pivot 설정 방법에 따라 알고리즘의 성
능이 달라진다. (이후 설명)
정렬 방법
Copyrightⓒ. Saebyeol Yu. All Rights Reserved.
002
정렬의 실생활 예시
Copyrightⓒ. Saebyeol Yu. All Rights Reserved.
KOI3125
Copyrightⓒ. Saebyeol Yu. All Rights Reserved.
2
정렬의 실생활 예시
Radix Sort
Copyrightⓒ. Saebyeol Yu. All Rights Reserved.
2
정렬의 실생활 예시
Quick Sort
Copyrightⓒ. Saebyeol Yu. All Rights Reserved.
2
정렬의 실생활 예시
Quick Sort
퀵 소트에서 키 순서를 제시한 이유는, 자기 자신을 Pivot으로 생각하면, 나보다 키 큰
친구는 뒤로 가라고 말해주고, 작은 친구는 앞으로 가라고 말해주면서, 줄을 서는 과
정을 Partition Step과 동일하게 생각할 수 있다. 라고 보충하여 설명하면, 이해가 편할
거 같아요!
- 발표 영상에서 생략되어서 PPT에 첨부하였습니다! 10번 슬라이드에 대한 보충 설
명입니다. -
Copyrightⓒ. Saebyeol Yu. All Rights Reserved.
003
정렬의 구현 방법
Copyrightⓒ. Saebyeol Yu. All Rights Reserved.
KOI3125
Copyrightⓒ. Saebyeol Yu. All Rights Reserved.
3
정렬의 구현 방법
Radix Sort
Copyrightⓒ. Saebyeol Yu. All Rights Reserved.
Copyrightⓒ. Saebyeol Yu. All Rights Reserved.
Copyrightⓒ. Saebyeol Yu. All Rights Reserved.
3
정렬의 구현 방법
Quick Sort
Copyrightⓒ. Saebyeol Yu. All Rights Reserved.
004
알고리즘 시간 비교(시간복잡도)
Copyrightⓒ. Saebyeol Yu. All Rights Reserved.
KOI3125
Copyrightⓒ. Saebyeol Yu. All Rights Reserved.
Copyrightⓒ. Saebyeol Yu. All Rights Reserved.
4
알고리즘 시간 비교
Radix Sort
알고리즘 (자료의 자릿수 : d, 자료 수 : n)
-> 각 자릿수마다 전체 자료를 Queue에 넣고 꺼내는 과정의 반복
-> 각 자릿수마다 -> O(d)
-> 전체 자료를 -> O(n)
-> 알고리즘 전체 시간복잡도 -> O(dn)
정렬 시 비교하는 자료의 크기에 따라 사용되는 시간이 달라짐.
d가 작으면 다른 정렬들보다 이득이다!
Copyrightⓒ. Saebyeol Yu. All Rights Reserved.
Copyrightⓒ. Saebyeol Yu. All Rights Reserved.
4
알고리즘 시간 비교
Quick Sort
알고리즘 (자료의 수 : n)
-> 자료중 하나를 Pivot으로 설정하여, 모든 자료를 Pivot과의 비교 후, 작으면 Pivot의 앞에, 크면 Pivot의 뒤에
배치한다.
-> 모든 자료를 Pivot과 비교 -> O(n)
-> Pivot과의 비교 후 -> 자료들을 계속 분할함(약 절반씩) -> O(log n)
-> 알고리즘 전체 시간복잡도 -> O(n log n)
하지만, 이는 평균적인 케이스이다.
항상 Pivot을 최대, 최솟값을 잡는 케이스라 가정하자.
-> 모든 자료를 Pivot과 비교 -> O(n)
-> Pivot과의 비교 후 -> 자료들을 계속 분할함(1개씩 없어짐) -> O(n)
-> 알고리즘 전체 시간복잡도 -> O(n^2)
평균적으로는 O(n log n)의 시간복잡도를 가지나, 최악의 경우에서는 O(n^2)의 경우를 가진다.
이를 해결하기 위해 Pivot을 설정하는 다양한 방법이 제시되었음.
Copyrightⓒ. Saebyeol Yu. All Rights Reserved.
005
GPT와의 코드 비교
Copyrightⓒ. Saebyeol Yu. All Rights Reserved.
KOI3125
Copyrightⓒ. Saebyeol Yu. All Rights Reserved.
Copyrightⓒ. Saebyeol Yu. All Rights Reserved.
5
GPT와의 코드 비교
Radix Sort
Copyrightⓒ. Saebyeol Yu. All Rights Reserved.
Copyrightⓒ. Saebyeol Yu. All Rights Reserved.
End
KOI3125
정렬 알고리즘 설명하기

More Related Content

Recently uploaded

A future that integrates LLMs and LAMs (Symposium)
A future that integrates LLMs and LAMs (Symposium)A future that integrates LLMs and LAMs (Symposium)
A future that integrates LLMs and LAMs (Symposium)Tae Young Lee
 
Merge (Kitworks Team Study 이성수 발표자료 240426)
Merge (Kitworks Team Study 이성수 발표자료 240426)Merge (Kitworks Team Study 이성수 발표자료 240426)
Merge (Kitworks Team Study 이성수 발표자료 240426)Wonjun Hwang
 
캐드앤그래픽스 2024년 5월호 목차
캐드앤그래픽스 2024년 5월호 목차캐드앤그래픽스 2024년 5월호 목차
캐드앤그래픽스 2024년 5월호 목차캐드앤그래픽스
 
MOODv2 : Masked Image Modeling for Out-of-Distribution Detection
MOODv2 : Masked Image Modeling for Out-of-Distribution DetectionMOODv2 : Masked Image Modeling for Out-of-Distribution Detection
MOODv2 : Masked Image Modeling for Out-of-Distribution DetectionKim Daeun
 
Console API (Kitworks Team Study 백혜인 발표자료)
Console API (Kitworks Team Study 백혜인 발표자료)Console API (Kitworks Team Study 백혜인 발표자료)
Console API (Kitworks Team Study 백혜인 발표자료)Wonjun Hwang
 
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...Kim Daeun
 

Recently uploaded (6)

A future that integrates LLMs and LAMs (Symposium)
A future that integrates LLMs and LAMs (Symposium)A future that integrates LLMs and LAMs (Symposium)
A future that integrates LLMs and LAMs (Symposium)
 
Merge (Kitworks Team Study 이성수 발표자료 240426)
Merge (Kitworks Team Study 이성수 발표자료 240426)Merge (Kitworks Team Study 이성수 발표자료 240426)
Merge (Kitworks Team Study 이성수 발표자료 240426)
 
캐드앤그래픽스 2024년 5월호 목차
캐드앤그래픽스 2024년 5월호 목차캐드앤그래픽스 2024년 5월호 목차
캐드앤그래픽스 2024년 5월호 목차
 
MOODv2 : Masked Image Modeling for Out-of-Distribution Detection
MOODv2 : Masked Image Modeling for Out-of-Distribution DetectionMOODv2 : Masked Image Modeling for Out-of-Distribution Detection
MOODv2 : Masked Image Modeling for Out-of-Distribution Detection
 
Console API (Kitworks Team Study 백혜인 발표자료)
Console API (Kitworks Team Study 백혜인 발표자료)Console API (Kitworks Team Study 백혜인 발표자료)
Console API (Kitworks Team Study 백혜인 발표자료)
 
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
 

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

정렬 알고리즘 작동 방식 및 예시 발표 & GPT 코드 비교 진행.pptx

  • 1. Copyrightⓒ. Saebyeol Yu. All Rights Reserved. Copyrightⓒ. Saebyeol Yu. All Rights Reserved. KOI3125
  • 2. Copyrightⓒ. Saebyeol Yu. All Rights Reserved. Contents  RadixSort  QuickSort  시간복잡도  실제실행시간 001 정렬의소개 002 정렬의실생활예시 003 정렬시간비교 004 GPT와의비교  GPT작성코드/Handmade코드  비교와대조  RadixSort  QuickSort
  • 3. Copyrightⓒ. Saebyeol Yu. All Rights Reserved. 001 정렬의 소개 Copyrightⓒ. Saebyeol Yu. All Rights Reserved. KOI3125
  • 4. Copyrightⓒ. Saebyeol Yu. All Rights Reserved. 기수 정렬 데이터의 직접적인 비교 없는 정렬! 데이터 직접 비교(a_1 > a_3) 그 대신 자릿수로 비교하는 정렬이 기수 정렬 Copyrightⓒ. Saebyeol Yu. All Rights Reserved. 1 정렬의 소개 Radix Sort 1. X진법에서 0 ~ X – 1번의 리스트를 만든다. 2. 데이터를 현재 자릿수가 가르키는 리스트에 Push 한다. 3. 리스트를 0 ~ X – 1번까지 순서대로 연결한다, 정렬 방법
  • 5. Copyrightⓒ. Saebyeol Yu. All Rights Reserved. Copyrightⓒ. Saebyeol Yu. All Rights Reserved. 1 정렬의 소개 Radix Sort 정렬 방법(그림)
  • 6. Copyrightⓒ. Saebyeol Yu. All Rights Reserved. 퀵 정렬 평균적인 상황에서 최고의 성능을 나타내는 알고리즘. 많은 정렬 구현체에서 사용되는 알고리즘이다. Copyrightⓒ. Saebyeol Yu. All Rights Reserved. 1 정렬의 소개 Quick Sort 1. 적절한 원소 하나를 기준(피봇, Pivot)으로 잡는다. 2. Pivot보다 작은 원소는 앞으로 빼고, 그 뒤에 Pivot을 옮겨 피벗보 다 작은 것, 큰것으로 나눈다. (Partition Step) 3. 나눠진 원소들에서 다시 피벗을 잡고 정렬하는 과정을 각 크기가 0, 1이 될때까지 정렬한다. 정렬 방법
  • 7. Copyrightⓒ. Saebyeol Yu. All Rights Reserved. Copyrightⓒ. Saebyeol Yu. All Rights Reserved. 1 정렬의 소개 Quick Sort 정렬 방법(그림) Pivot을 잡는 방식에는 여러 방법이 있다. 1. 맨 왼, 오른쪽을 잡는 방법 2. 랜덤한 원소를 잡는 방법 3. 3가지 값의 중앙값을 잡는 방법 다양한 Pivot 설정 방법에 따라 알고리즘의 성 능이 달라진다. (이후 설명) 정렬 방법
  • 8. Copyrightⓒ. Saebyeol Yu. All Rights Reserved. 002 정렬의 실생활 예시 Copyrightⓒ. Saebyeol Yu. All Rights Reserved. KOI3125
  • 9. Copyrightⓒ. Saebyeol Yu. All Rights Reserved. 2 정렬의 실생활 예시 Radix Sort
  • 10. Copyrightⓒ. Saebyeol Yu. All Rights Reserved. 2 정렬의 실생활 예시 Quick Sort
  • 11. Copyrightⓒ. Saebyeol Yu. All Rights Reserved. 2 정렬의 실생활 예시 Quick Sort 퀵 소트에서 키 순서를 제시한 이유는, 자기 자신을 Pivot으로 생각하면, 나보다 키 큰 친구는 뒤로 가라고 말해주고, 작은 친구는 앞으로 가라고 말해주면서, 줄을 서는 과 정을 Partition Step과 동일하게 생각할 수 있다. 라고 보충하여 설명하면, 이해가 편할 거 같아요! - 발표 영상에서 생략되어서 PPT에 첨부하였습니다! 10번 슬라이드에 대한 보충 설 명입니다. -
  • 12. Copyrightⓒ. Saebyeol Yu. All Rights Reserved. 003 정렬의 구현 방법 Copyrightⓒ. Saebyeol Yu. All Rights Reserved. KOI3125
  • 13. Copyrightⓒ. Saebyeol Yu. All Rights Reserved. 3 정렬의 구현 방법 Radix Sort Copyrightⓒ. Saebyeol Yu. All Rights Reserved.
  • 14. Copyrightⓒ. Saebyeol Yu. All Rights Reserved. Copyrightⓒ. Saebyeol Yu. All Rights Reserved. 3 정렬의 구현 방법 Quick Sort
  • 15. Copyrightⓒ. Saebyeol Yu. All Rights Reserved. 004 알고리즘 시간 비교(시간복잡도) Copyrightⓒ. Saebyeol Yu. All Rights Reserved. KOI3125
  • 16. Copyrightⓒ. Saebyeol Yu. All Rights Reserved. Copyrightⓒ. Saebyeol Yu. All Rights Reserved. 4 알고리즘 시간 비교 Radix Sort 알고리즘 (자료의 자릿수 : d, 자료 수 : n) -> 각 자릿수마다 전체 자료를 Queue에 넣고 꺼내는 과정의 반복 -> 각 자릿수마다 -> O(d) -> 전체 자료를 -> O(n) -> 알고리즘 전체 시간복잡도 -> O(dn) 정렬 시 비교하는 자료의 크기에 따라 사용되는 시간이 달라짐. d가 작으면 다른 정렬들보다 이득이다!
  • 17. Copyrightⓒ. Saebyeol Yu. All Rights Reserved. Copyrightⓒ. Saebyeol Yu. All Rights Reserved. 4 알고리즘 시간 비교 Quick Sort 알고리즘 (자료의 수 : n) -> 자료중 하나를 Pivot으로 설정하여, 모든 자료를 Pivot과의 비교 후, 작으면 Pivot의 앞에, 크면 Pivot의 뒤에 배치한다. -> 모든 자료를 Pivot과 비교 -> O(n) -> Pivot과의 비교 후 -> 자료들을 계속 분할함(약 절반씩) -> O(log n) -> 알고리즘 전체 시간복잡도 -> O(n log n) 하지만, 이는 평균적인 케이스이다. 항상 Pivot을 최대, 최솟값을 잡는 케이스라 가정하자. -> 모든 자료를 Pivot과 비교 -> O(n) -> Pivot과의 비교 후 -> 자료들을 계속 분할함(1개씩 없어짐) -> O(n) -> 알고리즘 전체 시간복잡도 -> O(n^2) 평균적으로는 O(n log n)의 시간복잡도를 가지나, 최악의 경우에서는 O(n^2)의 경우를 가진다. 이를 해결하기 위해 Pivot을 설정하는 다양한 방법이 제시되었음.
  • 18. Copyrightⓒ. Saebyeol Yu. All Rights Reserved. 005 GPT와의 코드 비교 Copyrightⓒ. Saebyeol Yu. All Rights Reserved. KOI3125
  • 19. Copyrightⓒ. Saebyeol Yu. All Rights Reserved. Copyrightⓒ. Saebyeol Yu. All Rights Reserved. 5 GPT와의 코드 비교 Radix Sort
  • 20. Copyrightⓒ. Saebyeol Yu. All Rights Reserved. Copyrightⓒ. Saebyeol Yu. All Rights Reserved. End KOI3125 정렬 알고리즘 설명하기