Skip to content

Leetcode binary tree inorder traversal#10

Open
Igneaalis wants to merge 12 commits intomasterfrom
LEETCODE-binary-tree-inorder-traversal
Open

Leetcode binary tree inorder traversal#10
Igneaalis wants to merge 12 commits intomasterfrom
LEETCODE-binary-tree-inorder-traversal

Conversation

@Igneaalis
Copy link
Copy Markdown
Owner

Added LEETCODE "binary-tree-inorder-traversal" iterative, nondestructive, stack-free, tag-free left inorder solution.

@Igneaalis Igneaalis requested a review from Vivelapaix June 1, 2020 23:19
:rtype: List[int]
"""
head = root
inorderlist = []
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Очень круто, но много кода. Ты такой код не успеешь написать быстро, много разных if. Можешь оставить

Но напиши рядом рекурсивное решение и решение, где ты рекурсию раскроешь через stack, т.е. получится итеративное решение без лишних if

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Наличие многих if - место для потенциальной ошибки. Решения здесь проще

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Vivelapaix добавил два решения. Ещё вопрос по гиту. Как изменить имя запушенного коммита?

Copy link
Copy Markdown

@Vivelapaix Vivelapaix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Можно было все в одном блоке python сделать, а не разбивать на 3. Комментариями бы решения отделил.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants