Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> comp.databases.theory -> Re: How is this collection called?
"Michael Mendelsohn" <keine.Werbung.1300_at_michael.mendelsohn.de> wrote in
message news:406940AB.883662FF_at_michael.mendelsohn.de...
> Mikito Harakiri schrieb:
> > Let '*' be binary aggregation operator.
>
> > Then, sets obey the following laws:
> > a*a=a
> > a*b=b*a
> > a*(b*c)=(a*b)*c
>
> > Lists:
> > a*a!=a
> > a*b!=b*a
> > a*(b*c)=(a*b)*c
>
> > What collection type meets
> > a*a!=a
> > a*b!=b*a
> > a*(b*c)!=(a*b)*c
> >
> > ?
>
> Stack?
> x * y := pop elements off stack x and push them on y
>
> Example:
> a=(1,2), b=(3,4), c=(5,6)
> a*b = (1,2)*(3,4) = (2)*(1,3,4) = (2,1,3,4)
> b*c = (3,4)*(5,6) = (4,3,5,6)
>
> (a*b)*c = (2,1,3,4) * (5,6) = (4,3,1,2,5,6)
> a*(b*c) = (1,2) * (4,3,5,6) = (2,1,4,3,5,6)
Thank you, Michael.
I actually had [binary labeled] tree in mind:-) Therefore, it looks like those axioms alone doesn't define structure uniquely. Or can anybody suggest an axiom that distinguish tree and stack? (On the other thought, expression tree is often implemented as stack, so maybe they are identical structures?)
As this looked as a homework to someone, can I really can be refered to some basic textobook? Received on Tue Mar 30 2004 - 09:59:13 CST