mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-13 09:12:28 +08:00
feat: update deleteTreeNode func
This commit is contained in:
@@ -63,6 +63,11 @@ func (t *BSTree[T]) InOrderTraverse() []T {
|
||||
return inOrderTraverse(t.root)
|
||||
}
|
||||
|
||||
// Depth returns the calculated depth of a binary saerch tree
|
||||
func (t *BSTree[T]) Depth() int {
|
||||
return calculateDepth(t.root, 0)
|
||||
}
|
||||
|
||||
// Print the bstree structure
|
||||
func (t *BSTree[T]) Print() {
|
||||
maxLevel := t.NodeLevel(t.root)
|
||||
|
||||
Reference in New Issue
Block a user