Skip to content

Tree Traversal in Ruby #646

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

tarunvelli
Copy link
Contributor

No description provided.

@berquist berquist added Hacktoberfest The label for all Hacktoberfest related things! Implementation This provides an implementation for an algorithm. (Code and maybe md files are edited.) labels Oct 13, 2019
@ntindle
Copy link
Member

ntindle commented Aug 28, 2021

[lang: ruby]

@github-actions github-actions bot added the lang: ruby Ruby programming language label Aug 28, 2021
Copy link
Contributor

@lazyprop lazyprop left a comment

Choose a reason for hiding this comment

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

Sorry it took so long to get to this.

One problem I notice is that you're not executing dfs_inorder anywhere. Also, there should be proper labels printed before each test case.

In accordance with #857 the final output should be identical to this:

[#]
Recursive DFS:
2 1 0 0 0 1 0 0 0 1 0 0 0
[#]
Recursive Postorder DFS:
0 0 0 1 0 0 0 1 0 0 0 1 2
[#]
Stack-based DFS:
2 1 0 0 0 1 0 0 0 1 0 0 0
[#]
Queue-based BFS:
2 1 1 1 0 0 0 0 0 0 0 0 0
[#]
Recursive Inorder DFS for Binary Tree:
0 1 0 2 0 1 0 3 0 1 0 2 0 1 0

Other than that, the code looks clean to me. I am not a Ruby dev, so someone else with more experience should probably take a look this.

@Amaras
Copy link
Member

Amaras commented Oct 26, 2021

Right, I just merged a PR to the master branch. Please resolve conflicts before we can consider merging.

Thank you for your reactivity after this long, though 😃

@tarunvelli
Copy link
Contributor Author

Resolved the merge conflicts
It was nice to get a notification from this repo after such a long time, always happy to contribute 😄

@tarunvelli
Copy link
Contributor Author

@Amaras @lazyprop I've rebased with the latest master

@leios
Copy link
Member

leios commented Dec 4, 2021

The reason these PR's take so long is that we don't have people who know the language (in this case ruby). On my end, it looks clean, so maybe I can just merge it as is?

@Amaras Amaras mentioned this pull request Dec 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hacktoberfest The label for all Hacktoberfest related things! Implementation This provides an implementation for an algorithm. (Code and maybe md files are edited.) lang: ruby Ruby programming language
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants