Next: Exercise 7. Up: Exercises Previous: Exercise 5.

Exercise 6.

Write a Maple procedure called structure that when given a Maple expression returns the structure of the expression as a tree, namely

For example: structure(x^3*sin(x)/cos(x)); should return


    [*, [^, x, 3], [function, sin, x], [^, [function, cos, x], -1]]

Your routine should handle the Maple types integer, fraction, float, `+`, `*`, `^`, string, indexed, function, range, equation, set, list, series and table. Test your function on the following input


   Int( exp(-t)*sqrt(t)*ln(t), t=0..infinity ) =
   int( exp(-t)*sqrt(t)*ln(t), t=0..infinity );


bondaren@thsun1.jinr.ru