Skip to content

Commit b8ae18e

Browse files
committed
fix solution: Construct Binary Tree from Preorder and Inorder Traversal
1 parent 871c2bc commit b8ae18e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

binary-tree-level-order-traversal/Gotprgmer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
// 시간복잡도 : O(N^2) -> 한쪽으로 치우친 트리일 경우 O(N)(index of) + T(N-1)이 될 수 있다.
2525
// 위 식을 전개해보면 N + N-1 + N-2 + ... + 1 = N(N+1)/2 = O(N^2)
2626
// 공간복잡도 : O(N) -> N길이의 리스트 크기
27-
class Solution {
27+
class SolutionGotprgmer {
2828
public TreeNode buildTree(int[] preorder, int[] inorder) {
2929

3030
if(preorder.length == 0 || indexOf(inorder,preorder[0]) == -1){

0 commit comments

Comments
 (0)