refactor: rename lancetconstraints package name to constraints

This commit is contained in:
dudaodong
2023-12-16 19:29:06 +08:00
parent 0b976e9a4c
commit 80e48f06ca
16 changed files with 92 additions and 92 deletions

View File

@@ -44,9 +44,9 @@ MaxHeap is a binary heap tree implemented by slice, The key of the root node is
```go
type MaxHeap[T any] struct {
data []T
comparator lancetconstraints.Comparator
comparator constraints.Comparator
}
func NewMaxHeap[T any](comparator lancetconstraints.Comparator) *MaxHeap[T]
func NewMaxHeap[T any](comparator constraints.Comparator) *MaxHeap[T]
```
<b>Example:</b>

View File

@@ -1100,12 +1100,12 @@ Common queue implemented by slice.
<b>Signature:</b>
```go
func NewPriorityQueue[T any](capacity int, comparator lancetconstraints.Comparator) *PriorityQueue[T]
func NewPriorityQueue[T any](capacity int, comparator constraints.Comparator) *PriorityQueue[T]
type PriorityQueue[T any] struct {
items []T
size int
comparator lancetconstraints.Comparator
comparator constraints.Comparator
}
```
<b>Example:</b>

View File

@@ -41,7 +41,7 @@ import (
## Documentation
## 1. BSTree
BSTree is a binary search tree data structure in which each node has at two children, which are referred to as the left child and the right child. In BSTree: leftNode < rootNode < rightNode. Type T should implements Compare function in lancetconstraints.Comparator interface.
BSTree is a binary search tree data structure in which each node has at two children, which are referred to as the left child and the right child. In BSTree: leftNode < rootNode < rightNode. Type T should implements Compare function in constraints.Comparator interface.
### <span id="NewBSTree">NewBSTree</span>
<p>Make a BSTree pointer instance</p>
@@ -49,11 +49,11 @@ BSTree is a binary search tree data structure in which each node has at two chil
<b>Signature:</b>
```go
func NewBSTree[T any](rootData T, comparator lancetconstraints.Comparator) *BSTree[T]
func NewBSTree[T any](rootData T, comparator constraints.Comparator) *BSTree[T]
type BSTree[T any] struct {
root *datastructure.TreeNode[T]
comparator lancetconstraints.Comparator
comparator constraints.Comparator
}
type TreeNode[T any] struct {