Skip to content
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

Add algorithms on basic trees #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add algorithms on basic trees #5

wants to merge 2 commits into from

Conversation

acorrenson
Copy link
Owner

I implemented n-ary trees and binary trees in OCaml

  • With BFS and DFS{PRE, POST, INF} traversal
  • With clean .dot format pretty printers

Copy link
Collaborator

@imartayan imartayan left a comment

Choose a reason for hiding this comment

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

Using a queue would be more efficient than a list for the bfs. We can use the Queue module from the standard library, or we can also implement our own queue module.

@acorrenson
Copy link
Owner Author

acorrenson commented Oct 6, 2020 via email

@Moxinilian
Copy link
Collaborator

Personally I would be in favor of using the Queue module. Not only is it more explicit and readable, but it moves the responsibility of performance to somebody else.

@acorrenson
Copy link
Owner Author

acorrenson commented Oct 6, 2020

Using the queue module is a bit cheating since this is an educational project ^^. I'm going to implement functionnal queues (based on the book of Conchon and Filliâtre)

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.

None yet

5 participants