Skip to content

Commit 98c02f2

Browse files
committed
typo 등 책과 통일
1 parent c7e0a0a commit 98c02f2

File tree

62 files changed

+35
-34
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+35
-34
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.

13장_이진_트리/2_binary_tree.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def is_root(self, value):
141141
def get_height(self):
142142
return self.root._get_max_height()
143143

144-
def is_balnced(self):
144+
def is_balanced(self):
145145
return self.root._is_balanced()
146146

147147
def is_bst(self):

13장_이진_트리/3_binary_search_tree.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,11 @@ def add_node(self, value):
7474
# for i in range(1, 10):
7575
for i in [6, 4, 8, 2, 5, 7, 9, 1, 3]:
7676
bst.add_node(i)
77-
print("노드 8은 말단 노드입니까? ", bst.isLeaf(8))
78-
print("노드 1의 레벨은? ", bst.getNodeLevel(1))
79-
print("노드 10은 루트 노드입니까? ", bst.isRoot(10))
80-
print("노드 1은 루트 노드입니까? ", bst.isRoot(1))
81-
print("트리의 높이는? ", bst.getHeight())
82-
print("이진 탐색 트리입니까? ", bst.isBST())
83-
print("균형 트리입니까? ", bst.isBalanced())
77+
print("노드 8은 말단 노드입니까? ", bst.is_leaf(8))
78+
print("노드 1의 레벨은? ", bst.get_node_level(1))
79+
print("노드 10은 루트 노드입니까? ", bst.is_root(10))
80+
print("노드 1은 루트 노드입니까? ", bst.is_root(1))
81+
print("트리의 높이는? ", bst.get_height())
82+
print("이진 탐색 트리입니까? ", bst.is_bst())
83+
print("균형 트리입니까? ", bst.is_balanced())
8484
# pre_order(bst.root)

13장_이진_트리/4_AVL_BST.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def rotate(self, value):
2828
self.height = 1 + max(self.get_height(self.left),
2929
self.get_height(self.right))
3030

31-
# 3) 균형 요소(왼쪽 트리 높이 - 오른쪽 트리 높이)
31+
# 3) 균형도(왼쪽 트리 높이 - 오른쪽 트리 높이)
3232
balance = self.get_balance()
3333

3434
# 4) 트리의 균형이 맞지 않을 경우 회전한다.
@@ -60,8 +60,8 @@ def left_rotate(self):
6060
x [y]
6161
/ \ / \
6262
y T3 <---- T1 x
63-
/ \ (왼쪽 회전) / \
64-
T1 T2 T2 T3
63+
/ \ (왼쪽 회전) / \
64+
T1 T2 T2 T3
6565
"""
6666
x = self.right
6767
T2 = x.left
@@ -85,8 +85,8 @@ def right_rotate(self):
8585
[x] y
8686
/ \ / \
8787
y T3 ----> T1 x
88-
/ \ (오른쪽 회전) / \
89-
T1 T2 T2 T3
88+
/ \ (오른쪽 회전) / \
89+
T1 T2 T2 T3
9090
"""
9191
y = self.left
9292
T2 = y.right

14장_트리_순회/3_transversal_BST_ancestor.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33

44
def find_ancestor(path, low_value, high_value):
5+
# 두 인수는 트리에 존재하는 노드여야 하며 두 번째 인수가 더 커야 한다.
56
while path:
67
current_value = path[0]
78
if current_value < low_value:
@@ -26,7 +27,7 @@ def find_ancestor(path, low_value, high_value):
2627
path = bst.preorder()
2728
print("전위 순회: ", path)
2829

29-
print("1과 6의 공통 상위 조상 :", find_ancestor(path, 1, 6))
30-
print("1과 11의 공통 상위 조상: ", find_ancestor(path, 1, 11))
31-
print("1과 4의 공통 상위 조상: ", find_ancestor(path, 1, 4))
32-
print("8와 9의 공통 상위 조상: ", find_ancestor(path, 8, 9))
30+
print("1과 6의 최소 공통 조상 :", find_ancestor(path, 1, 6))
31+
print("1과 11의 최소 공통 조상: ", find_ancestor(path, 1, 11))
32+
print("1과 4의 최소 공통 조상: ", find_ancestor(path, 1, 4))
33+
print("8와 9의 최소 공통 조상: ", find_ancestor(path, 8, 9))

0 commit comments

Comments
 (0)