Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Sep 7, 2025. It is now read-only.
/pythonPublic archive

zigzag traversal in a binary tree#120

Merged
abranhe merged 1 commit intoAllAlgorithms:masterfromSakshiiAgrawal:master
Nov 7, 2020
Merged

zigzag traversal in a binary tree#120

abranhe merged 1 commit intoAllAlgorithms:masterfromSakshiiAgrawal:master
Nov 7, 2020

Conversation

@SakshiiAgrawal
Copy link
Contributor

@SakshiiAgrawalSakshiiAgrawal commentedOct 21, 2020
edited
Loading

The idea is to use two stacks. We can use one stack for printing from left to right and other stack for printing from right to left. In every iteration, we have nodes of one level in one of the stacks. We print the nodes, and push nodes of next level in other stack.

I am creating a pull request for...

  • [yes ] New algorithm
  • Update to an algorithm
  • Fix an error
  • Other -Describe below

The idea is to use two stacks. We can use one stack for printing from left to right and other stack for printing from right to left. In every iteration, we have nodes of one level in one of the stacks. We print the nodes, and push nodes of next level in other stack.
Copy link
Contributor

@hemanth-kotagirihemanth-kotagiri left a comment

Choose a reason for hiding this comment

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

LGTM.

s2.pop()
print(temp.data, end = " ")

# Note that is rightt is appended before left
Copy link
Contributor

Choose a reason for hiding this comment

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

Just one small change.rightt toright. Writing well-documented code is extremely important. Try fixing any other issues of the same kind. Code LGTM.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

sure, will do it

Copy link
Member

@abranheabranhe left a comment

Choose a reason for hiding this comment

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

Thanks so much for your contribution toThe All ▲lgorithms Project. Without people like you submitting Pull Requests we couldn't run this project. You rock!

@abranheabranhe merged commit7f12f2c intoAllAlgorithms:masterNov 7, 2020
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

2 more reviewers

@hemanth-kotagirihemanth-kotagirihemanth-kotagiri requested changes

@abranheabranheabranhe approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@SakshiiAgrawal@abranhe@hemanth-kotagiri

[8]ページ先頭

©2009-2025 Movatter.jp