oldk1331 wrote:
> 
> Some example for the missing functions:
> 

Implementing missing functions is good.  However you
also have different representaion for BinaryTree.
AFAICS this represention uses at least the same
memory as current one and possibly more.  Namely,
'Union' constructor insert one list node that
is two words.  Records with 3 or more fields
use Lisp vectors which in this case needs 4 words.
So you need 6 words for normal node and two words
for empty case.  Current representation needs
3 list nodes in normal case that is 6 words.
In current representation empty tree is represented
as Lisp NIL, which takes no extra space.  So
if all empty markeres are separately alocated
your representation needs 6*N + 2*(N+1) words
for tree with N normal nodes, while current
representation only takes 6*N.  In principle
we only need one empty marker (we can share it)
but AFAICS your code allocates fresh markers.

Concerning execution time: current code may
need extra indirection compared to your code.
So you may have some speed gain.  But testing
for empty markers is more complicated in
your version.  Also, there are implementation
artifacts -- last time when I benchmarked sbcl
allocating list nodes was significantly faster
than allocating vectors.  So it is hard to
say which version is faster, to find out one
needs to time various test programs.
-- 
                              Waldek Hebisch

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to