maketree( ,maketree( ,emptytree,leaf( )),maketree( ,leaf( ),leaf( )))which is much simpler than the construction using the primitive operatorst maketree( maketree( ,maketree( ,emptytree,emptytree)maketree( ,emptytree,maketree( ,emptytree,emptytree)))maketree( ,maketree( ,emptytree,maketree( ,emptytree,emptytree))maketree( ,maketree( ,emptytree,emptytree)maketree( ,emptytree,emptytree)))note that the selectors can only operate on non-empty trees for examplefor the tree defined above we have root(left(left( ) but the expression root(left(left(left( )))does not make sense because left(left(left( ))emptytree and the empty tree does not have root in language such as javathis would typically raise an exception in language such as this would cause an unpredictable behaviourbut if you are luckya core dump will be produced and the program will be aborted with no further harm when writing algorithmswe need to check the selector arguments using isempty(tbefore allowing their use the following equations should be obvious from the primitive operator definitionsroot(maketree( , , ) left(maketree( , , ) right(maketree( , , ) isempty(emptytreetrue isempty(maketree( , , )false the following makes sense only under the assumption that is non-empty treemaketree(root( ),left( ),right( ) it just says that if we break apart non-empty tree and use the pieces to build new treethen we get an identical tree back it is worth emphasizing that the above specifications of quad-trees and binary trees are further examples of abstract data typesdata types for which we exhibit the constructors and destructors and describe their behaviour (using equations such as defined above for listsstacksqueuesquad-trees and binary trees)but for which we explicitly hide the implementational details the concrete data type used in an implementation is called data structure for examplethe usual data structures used to implement the list and tree data types are records and pointers but other implementations are possible the important advantage of abstract data types is that we can develop algorithms without having to worry about the details of the representation of the data or the implementation of courseeverything will ultimately be represented as sequences of bits in computerbut we clearly do not generally want to have to think in such low level terms