본문 바로가기

python

[알고리즘] Leetcode #179 가장 큰 수 (Python) ↓↓↓ 아래는 내 리트코드 & 깃허브 계정 ↓↓↓ leetcode.com/Jiwon_Lee/ Jiwon Lee - LeetCode Profile Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com https://github.com/GodJiLee GodJiLee - Overview Interested in Data Science. GodJiLee has 17 repositories available. Follow their code on GitHub. github.com Leetco.. 더보기
[알고리즘] Leetcode #147 삽입 정렬 리스트 (Python) ↓↓↓ 아래는 내 리트코드 & 깃허브 계정 ↓↓↓ leetcode.com/Jiwon_Lee/ Jiwon Lee - LeetCode Profile Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com https://github.com/GodJiLee GodJiLee - Overview Interested in Data Science. GodJiLee has 17 repositories available. Follow their code on GitHub. github.com Leetco.. 더보기
[알고리즘] Leetcode #56 구간 병합 (Python) ↓↓↓ 아래는 내 리트코드 & 깃허브 계정 ↓↓↓ leetcode.com/Jiwon_Lee/ Jiwon Lee - LeetCode Profile Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com https://github.com/GodJiLee GodJiLee - Overview Interested in Data Science. GodJiLee has 17 repositories available. Follow their code on GitHub. github.com Leetco.. 더보기
[알고리즘] Leetcode #148 리스트 정렬 (Python) ↓↓↓ 아래는 내 리트코드 & 깃허브 계정 ↓↓↓ leetcode.com/Jiwon_Lee/ Jiwon Lee - LeetCode Profile Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com https://github.com/GodJiLee GodJiLee - Overview Interested in Data Science. GodJiLee has 17 repositories available. Follow their code on GitHub. github.com 안정 정렬 .. 더보기
[알고리즘] 정렬(Sorting) - 버블 정렬, 병합 정렬, 퀵 정렬 정렬 목록의 요소를 특정 순서대로 넣는 알고리즘 대개 숫자식 순서(numeric order)와 사전식 순서(lexigraphical order)로 정렬함 버블 정렬 복잡도 O(n^2)으로 비효율적인 편 # 버블 정렬 수도코드 Bubblesort(A) for i from 1 to A.length for j from 0 to A.length - 1 if A[j] > A[j + 1] swap a[j] with a[j + 1] def bubblesort(A): for i in range(1, len(A)): for j in range(1, len(A) - 1): if A[j] > A[j + 1]: A[j], A[j + 1] = A[j + 1], A[j] # swap 병합 정렬 최선과 최악 모두 O(n log n.. 더보기
[알고리즘] Leetcode #336 팰린드롬 페어 (Python) ↓↓↓ 아래는 내 리트코드 & 깃허브 계정 ↓↓↓ leetcode.com/Jiwon_Lee/ Jiwon Lee - LeetCode Profile Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com https://github.com/GodJiLee GodJiLee - Overview Interested in Data Science. GodJiLee has 17 repositories available. Follow their code on GitHub. github.com 문제 설명 .. 더보기
[알고리즘] Leetcode #215 배열의 K번째 큰 요소 (Python) ↓↓↓ 아래는 내 리트코드 계정 ↓↓↓ leetcode.com/Jiwon_Lee/ Jiwon Lee - LeetCode Profile Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제 설명 Given an integer array nums and an integer k, return the kth largest element in the array. Note that it is the kth largest element in the sorted order, not the kt.. 더보기
[자료구조] 힙(Heap) 연산 - 삽입/추출 구현하기 (Python) 힙(Heap) : 힙의 특성* 을 만족하는 거의 완전한 트리(Almost Complete Tree)인 특수한 자료구조 * 힙의 특성: 최소 힙(Min Heap)에서는 부모가 항상 자식보다 작거나 같음 : 우선순위 큐의 heapq 모듈이 힙으로 구현됨 (heapq.heappush() 및 heapq.heappop()) : 우선순위 큐는 힙으로 만들어지며, 힙은 배열로 만들어지지만 항상 정렬된 구조를 갖지 않음 : 인덱스는 1부터 시작(계산을 용이하게 하기 위함)하며, 자식 노드로 레벨이 내려갈 수록 인덱스는 2배씩 커짐 (왼쪽 노드 기준) : 우선순위큐, 다익스트라 알고리즘, 중앙값의 근사값 찾는 문제에 활용 삽입 연산 - Up Heap 사용 요소를 가장 하위 레벨의 최대한 왼쪽으로 삽입한다. 부모 값과 비.. 더보기