Skip to content

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

@EggsyOnCode

Description

@EggsyOnCode

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
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions