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

Support for sorting elements in descending order in AVL tree #54

Open
EggsyOnCode opened this issue Jul 28, 2024 · 0 comments
Open

Support for sorting elements in descending order in AVL tree #54

EggsyOnCode opened this issue Jul 28, 2024 · 0 comments

Comments

@EggsyOnCode
Copy link

EggsyOnCode commented Jul 28, 2024

avl.New[int, string](g.Less[int])

We should be able to use a custom comparator for sorting elements but currently that is not supported

This can be accomplished by adding the following func in the generic.go file

func Greater[T constraints.Ordered](a, b T) bool {
	return a > b
}
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