--- a/BinaryTree.st Fri Dec 04 19:47:55 2015 +0100
+++ b/BinaryTree.st Fri Dec 18 11:30:56 2015 +0100
@@ -11,6 +11,8 @@
"
"{ Package: 'stx:libbasic2' }"
+"{ NameSpace: Smalltalk }"
+
Collection subclass:#BinaryTree
instanceVariableNames:'treeRoot sortBlock'
classVariableNames:'DefaultSortBlock'
@@ -45,6 +47,14 @@
The worst case is to add elements in order, reverseOrder or zig-zag order.
Use instances of my subclasses, which balance the tree if in doubt.
+ EXTRA WARNING:
+ the inherited storeString will generate the elements in sorted order,
+ which generates exactly the generated case when read-back.
+ If you use this class and need textual persistency, you should consider rewriting
+ the storeOn: method, to enumerate elements in a binary segmentation fashion.
+ Otherwise, please use one of the balanced trees instead,
+ for example AATree or BTree.
+
Changes:
Changed to be Collection-protocol compatible.
Slight speedup in insert-code.
@@ -442,11 +452,11 @@
!BinaryTree class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic2/BinaryTree.st,v 1.17 2013-06-25 11:23:37 cg Exp $'
+ ^ '$Header$'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libbasic2/BinaryTree.st,v 1.17 2013-06-25 11:23:37 cg Exp $'
+ ^ '$Header$'
! !