일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- python sorted
- 코틀린기초
- 릿코드풀이
- 파이썬 프로그래머스
- leetcode 풀기
- python priority queue
- 파이썬 릿코드
- 알고리즘풀이
- python 알고리즘
- 파이썬릿코드
- 파이썬 알고리즘 풀기
- 잇츠디모
- 파이썬릿코드풀기
- 상가수익률계산기
- 알고리즘풀기
- python Leetcode
- python zip_longest
- 릿코드
- 파이썬 알고리즘
- leetcode풀이
- 릿코드 풀기
- 릿코드 파이썬
- python 릿코드
- python xor
- binary search
- LeetCode
- leetcode풀기
- 릿코드풀기
- 파이썬알고리즘풀기
- 파이썬알고리즘
- Today
- Total
목록Binary Search Tree (3)
소프트웨어에 대한 모든 것

바이너리 서치 트리에(Binary Search Tree) 대해서 알아보겠습니다. 기본적인 내용은 다들 알고 계시지만 insert(), search(), delete()를 직접 구현한 분들은 많지 않을 것 같습니다. 학부 때 자료구조나 알고리즘 수업 시간에 구현을 했었을 수도 있지만 막상 당장 지금 구현하라고 하면 키보드에서 손이 멈칫 멈칫 할 것입니다. 바이너리 서치 트리(이하 BST) 구조 노드의 왼쪽 서브트리는 노드의 key 값 보다 작은 값을 갖는 노드로 구성 노드의 오른쪽 서브트리는 노드의 key 값 보다 큰 값을 갖는 노드로 구성 왼쪽과 오른쪽 서브트리도 각각 binary search tree로 구성되어야 함 BST 시간 복잡도 BST는 일반적으로 삽입, 탐색, 삭제는 O(logn)의 시간 복잡..

1382. Balance a Binary Search Tree https://leetcode.com/problems/balance-a-binary-search-tree/ Balance a Binary Search Tree - LeetCode 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 문제) 솔루션1) - Bianry Search Tree 풀이 전략: 넘겨 받은 root 트리를 inorder 순회하여 정렬된 val를 리스트를(nums) 구성 Binary Search Tree ..

450. Delete Node in a BST https://leetcode.com/problems/delete-node-in-a-bst/ Delete Node in a BST - LeetCode 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 문제) 솔루션1) - recursive 이진 탐색 트리에서 노드 삭제 구현 여부를 물어보는 문제입니다. 재귀적인 방법으로 노드 삭제를 구현하는 일반적인 방법입니다. Example 1) 형태로 결과가 나오도록 구현하였습니다. 삭제 대상 노드..