generic icon indicating copy to clipboard operation
generic copied to clipboard

Support for sorting elements in descending order in AVL tree

Open EggsyOnCode opened this issue 6 months ago • 0 comments

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
}

EggsyOnCode avatar Jul 28 '24 19:07 EggsyOnCode