Download Maple Introductory Programming Guide

Transcript
162
•
Chapter 4: Basic Data Structures
> queue[length](q);
3
> queue[front](q);
h
> eval(‘q‘);
table([0 = 3, 1 = h, 2 = a, 3 = t])
Remove the letters from the queue. The original order of the letters
is maintained.31
> while not queue[empty](q) do queue[dequeue](q); end do;
h
a
t
Other important data structures are the connected graph and adjacency matrix. For more information on these data structures, see 6.10 Using Data Structures to Solve Problems.
There are many other data structures in Maple. For example, the
matrix32 and vector33 constructors create special cases of arrays, and
the Matrix34 and Vector35 constructors create special cases of Arrays.
4.8
Troubleshooting
This section provides you with a list of common mistakes, examples, and
hints that will help you understand and avoid common errors. Use this
31
The order of this result is the reverse of that in the example in the preceding
subsection Stacks.
32
For information on the matrix constructor, refer to ?matrix.
33
For information on the vector constructor, refer to ?vector.
34
For information on the Matrix constructor, refer to ?Matrix.
35
For information on the Vector constructor, refer to ?Vector.