Programming 썸네일형 리스트형 [알고리즘] Leetcode #105 전위, 중위 순회 결과로 이진 트리 구축(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 two integer arrays preorder and inorder where preorder is the preorder traversal of a binary tree and inorder is the inorder traversal of the same tree, con.. 더보기 [자료구조] 트리 순회 - 재귀구조 DFS로 preoder, inorder, postorder 구현 (Python) 트리 순회 : 그래프 순회의 일종으로 각 노드를 정확히 한 번씩 방문하는 과정 : DFS, BFS로 탐색할 수 있으며, DFS 탐색의 경우 전위, 중위, 후위 순회가 있음 1) 전위 순회 (NLR) # 전위 순회 (NLR) def preorder(node): if node is None: return print(node.val) preorder(node.left) preorder(node.right) 2) 중위 순회 (LNR) # 중위 순회 (LNR) def inorder(node): if node is None: return inorder(node.left) print(node.val) inorder(node.right) 3) 후위 순회 (LRN) # 후위 순회 (LRN) def postorder(no.. 더보기 [알고리즘] Leetcode #783 이진 탐색 트리(BST) 노드 간 최소 거리 (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 the root of a Binary Search Tree (BST), return the minimum difference between the values of any two different nodes in the tree. 입출력 예 Example 1: Input: roo.. 더보기 [알고리즘] Leetcode #938 이진 탐색 트리(BST) 합의 범위 (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 the root node of a binary search tree and two integers low and high, return the sum of values of all nodes with a value in the inclusive range [low, high]. .. 더보기 [알고리즘] Leetcode #1038 이진탐색트리(BST)를 더 큰 수의 합계 트리로 (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 the root of a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus sum of all .. 더보기 [알고리즘] Leetcode #108 정렬된 배열의 이진 탐색 트리 변환 (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 where the elements are sorted in ascending order, convert it to a height-balanced binary search tree. A height-balanced binary tree is.. 더보기 [알고리즘] Leetcode #310 최소 높이 트리 (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 문제 설명 A tree is an undirected graph in which any two vertices are connected by exactly one path. In other words, any connected graph without simple cycles is a tree. Gi.. 더보기 [알고리즘] Leetcode #110 균형 이진 트리 (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 a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as: a binary tree in which the left and right .. 더보기 이전 1 2 3 4 5 ··· 7 다음