aboutsummaryrefslogtreecommitdiff
path: root/src/input/bags.input.pamphlet
blob: b884079aa59635c191b876449c0ab4dfef0738f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
\documentclass{article}
\usepackage{axiom}
\begin{document}
\title{\$SPAD/src/input bags.input}
\author{The Axiom Team}
\maketitle
\begin{abstract}
\end{abstract}
\eject
\tableofcontents
\eject
\section{License}
<<license>>=
--Copyright The Numerical Algorithms Group Limited 1994.
@
<<*>>=
<<license>>
a:Stack INT:= stack [1,2,3,4,5]
pop! a
a
push!(9,a)
a
empty? a
b:=empty()$(Stack INT)
empty? b
c:ArrayStack INT:= arrayStack [1,2,3,4,5]
pop! c
c
push!(9,c)
c
empty? c
d:=empty()$(ArrayStack INT)
empty? d
e:Queue INT:= queue [1,2,3,4,5]
dequeue! e
e
enqueue!(9,e)
e
empty? e
f:=empty()$(Queue INT)
empty? f
g:Dequeue INT:= dequeue [1,2,3,4,5]
extractBottom! g
g
insertBottom!(9,g)
g
extractTop! g
g
insertTop!(9,g)
g
empty? g
h:=empty()$(Dequeue INT)
empty? h
i:Heap INT := bag [1,6,3,7,5,2,4]
insert!(10,i)
i
max i
extract! i
i
heapsort x ==
       empty? x => []
       cons(extract! x,heapsort x)
heapsort i
@
\eject
\begin{thebibliography}{99}
\bibitem{1} nothing
\end{thebibliography}
\end{document}