Skip to content

Conversation

@athulappadan
Copy link

This is a simple implementation of red black tree. Looking forward for comments.

key :: K
data :: V
left :: Tree{K,V}
right :: Tree{K,V}
Copy link
Member

Choose a reason for hiding this comment

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

This is probably the most straightforward implementation. Performance-wise, however, in Julia, it's a bad idea to have abstract members of types.

A workaround: JuliaLang/julia#15791 (comment)

(You'll probably have to read the whole thread for context.)

@kmsquire
Copy link
Member

kmsquire commented Apr 9, 2016

Seems like a reasonable start. It would be good to

  1. add some tests, to show that it works. Probably also need to be able to display the tree somehow.
  2. look at the tests for AVL trees, and compare the performance.

@athulappadan
Copy link
Author

Thanks for the suggestions. Will commit the changes soon.

@athulappadan
Copy link
Author

I have been going through the docs and different packages to understand how to efficiently define types, but still haven't got a grip on it. Main doubts are regarding abstract types, defining types recursively, parametric types, performance etc. Can anybody suggest some materials, papers to get some clarity on the julia type system..?

@timholy
Copy link
Member

timholy commented Sep 10, 2016

There are several good books and other learning resources, including those mentioned here.

@kmsquire
Copy link
Member

@athulappadan, I'm going to close this, but feel free to ping back here if you work on this some more, and someone can reopen it. Or, you can just open another pull request.

@kmsquire kmsquire closed this May 28, 2017
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.

3 participants