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

Allow for the addition of Node objects #13

Open
Beakerboy opened this issue Nov 24, 2023 · 1 comment
Open

Allow for the addition of Node objects #13

Beakerboy opened this issue Nov 24, 2023 · 1 comment

Comments

@Beakerboy
Copy link
Contributor

Beakerboy commented Nov 24, 2023

A user may wish to extend the Node object, or implement the Node interface within a custom object. The RedBlackTree could be made to accept these objects and organize them appropriately. This would allow users to implement more complicated sorting strategies then just a singular int, like sorting against a tuple or a custom function.

One consideration is the delete function. Would the user have to provide the exact object they with to remove, or just a key? I guess both could work.

@Beakerboy
Copy link
Contributor Author

Alternatively, do you feel the better approach is to use the existing Node, and the user should add their custom object as the Node’s value?

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

No branches or pull requests

1 participant