-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
Introducing binary search tree implementation #15
Conversation
Hi @spirosmaggioros, Thanks for your contribution and happy new year!! What is the difference compared to the previous implementation? https://github.com/TheAlgorithms/Zig/blob/main/search%2FbinarySearchTree.zig |
Happy new year to you too! Actually i want to contribute a lot and i started by trying fixing the already implemented data structures. I can try and merge my additions into the already implemented file if you wish. Thanks. |
Please, it would help a lot, avoiding redundancies. |
Now the new BST function has more methods and in general feels more like my previous DoublyLinkedList implementation.
Just commited this. I updated the BinarySearchTree.zig with the new implementation instead of creating one at dataStructures. @kassane Do i have to add this to build.zig and runall.sh? |
Again? Lines 47 to 53 in e68f833
Line 34 in e68f833
Line 34 in e68f833
rebase and add doublyLinkedList |
Sorry, i forgot it exists. |
Awesome contributions, @spirosmaggioros |
Implemented a binary serach tree in zig:
Methods:
insert
), removing (remove
), and searching (search
) elements in the tree.inorder
), preorder (preorder
), and postorder (postorder
) traversals.destroy
method to deallocate memory used by the tree.Also, the PR includes the unit tests for the container.