알고리즘/알고리즘 문제 복기

Leetcode - 104. Maximum Depth of Binary Tree

내일도무사히 2021. 2. 14. 17:27

leetcode.com/problems/maximum-depth-of-binary-tree/

 

Maximum Depth of Binary 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

 

Answer

 

 

처음에 Left Depth, right depth라는걸 새로 만들어서 구현하려고 했어서 좀 헤매긴 했는데 

 

다행히 DFS에 대해 사전지식이 약간이나마 있어서인지 풀 수 있었다.

 

하지만 트리라던지, 기존의 알고리즘 배웠던 것들을 까먹은 것들이 많아서 다시 복습을 할 필요성을 느꼈다