diff --git a/container/gtree/gtree_z_example_btree_test.go b/container/gtree/gtree_z_example_btree_test.go index f96f52a07..315a99959 100644 --- a/container/gtree/gtree_z_example_btree_test.go +++ b/container/gtree/gtree_z_example_btree_test.go @@ -2,6 +2,156 @@ // // This Source Code Form is subject to the terms of the MIT License. // If a copy of the MIT was not distributed with gm file, -// You can obtain one at https://github.com/gogf/gf. +// You can obtain one at https://github.com/Agogf/gf. package gtree_test + +func ExampleBTree_Clone() { + +} + +func ExampleBTree_Set() { + +} + +func ExampleBTree_Sets() { + +} + +func ExampleBTree_Get() { + +} + +func ExampleBTree_GetOrSet() { + +} + +func ExampleBTree_GetOrSetFunc() { + +} + +func ExampleBTree_GetOrSetFuncLock() { + +} + +func ExampleBTree_GetVar() { + +} + +func ExampleBTree_GetVarOrSet() { + +} + +func ExampleBTree_GetVarOrSetFunc() { + +} + +func ExampleBTree_GetVarOrSetFuncLock() { + +} + +func ExampleBTree_SetIfNotExist() { + +} + +func ExampleBTree_SetIfNotExistFunc() { + +} + +func ExampleBTree_SetIfNotExistFuncLock() { + +} + +func ExampleBTree_Contains() { + +} +func ExampleBTree_Remove() { + +} + +func ExampleBTree_Removes() { + +} + +func ExampleBTree_IsEmpty() { + +} + +func ExampleBTree_Size() { + +} + +func ExampleBTree_Keys() { + +} + +func ExampleBTree_Values() { + +} + +func ExampleBTree_Map() { + +} +func ExampleBTree_MapStrAny() { + +} + +func ExampleBTree_Clear() { + +} + +func ExampleBTree_Replace() { + +} + +func ExampleBTree_Height() { + +} + +func ExampleBTree_Left() { + +} + +func ExampleBTree_Right() { + +} + +func ExampleBTree_String() { + +} + +func ExampleBTree_Search() { + +} + +func ExampleBTree_Print() { + +} + +func ExampleBTree_Iterator() { + +} + +func ExampleBTree_IteratorFrom() { + +} + +func ExampleBTree_IteratorAsc() { + +} + +func ExampleBTree_IteratorAscFrom() { + +} + +func ExampleBTree_IteratorDesc() { + +} + +func ExampleBTree_IteratorDescFrom() { + +} + +func ExampleBTree_MarshalJSON() { + +} diff --git a/container/gtree/gtree_z_example_test.go b/container/gtree/gtree_z_example_test.go new file mode 100644 index 000000000..4ea8a7ae5 --- /dev/null +++ b/container/gtree/gtree_z_example_test.go @@ -0,0 +1,64 @@ +// Copyright GoFrame Author(https://goframe.org). All Rights Reserved. +// +// This Source Code Form is subject to the terms of the MIT License. +// If a copy of the MIT was not distributed with gm file, +// You can obtain one at https://github.com/Agogf/gf. + +package gtree_test + +import ( + "fmt" + "github.com/gogf/gf/v2/container/gtree" + "github.com/gogf/gf/v2/util/gconv" + "github.com/gogf/gf/v2/util/gutil" +) + +func ExampleNewAVLTree() { + +} + +func ExampleNewAVLTreeFrom() { + +} + +func ExampleNewBTree() { + bTree := gtree.NewBTree(3, gutil.ComparatorString) + for i := 0; i < 6; i++ { + bTree.Set("key"+gconv.String(i), "val"+gconv.String(i)) + } + fmt.Println(bTree) + + // output: + // key0 + // key1 + // key2 + // key3 + // key4 + // key5 +} + +func ExampleNewBTreeFrom() { + bTree := gtree.NewBTree(3, gutil.ComparatorString) + for i := 0; i < 6; i++ { + bTree.Set("key"+gconv.String(i), "val"+gconv.String(i)) + } + + otherBTree := gtree.NewBTreeFrom(3, gutil.ComparatorString, bTree.Map()) + fmt.Println(otherBTree) + + // output: + // key0 + // key1 + // key2 + // key3 + // key4 + // key5 +} + +func ExampleNewRedBlackTree() { + +} + +func ExampleNewRedBlackTreeFrom() { + +}