Nested arrays and recursion
Čebyševskij sbornik, Tome 16 (2015) no. 3, pp. 479-495.

Voir la notice de l'article provenant de la source Math-Net.Ru

Problem solving with data presented nested arrays, is difficult because they of the rather is unpredictаble in their structure. And here, in many cases helps recursion. Its use allows linearly according to the same scheme to implement a run on all the elements of each nesting level of any of the array, regardless of its structure and the depth of nesting. Nested array can be interpreted by a tree, whose root is the array itself, from its go arc to the array elements, etc. The leaves of this tree are scalars or strings — finite elements that are not referenced in the following arrays. In an article for the solution of several problems of a General nature with nested arrays is offered appropriate recursive program-functions. Examples of such tasks: calculate the total number of leaves of the array; to form an array of transposed elements of the original array at all levels of nesting; determine whether a given object (scalar, string, a simple array, nested array) of a element of this array to any level of nesting; count the number of occurrences of an object in the array at all levels of nesting; collect all the leaves of the array into the vector, replacing the leaves a given array on components the vector, etc. In all cases, recursive triad is as follows: the parameter of recursion — nest array; decomposition — transitions at all levels of nesting of arrays to their elements, and so on until the leaves; recursive base, i.e. the trivial cases in recursion — lists of arrays [1]. Offer laconic recursive programs-features of the solution are listed and some other tasks are implemented on a simple and intuitive programming language system engineering and scientific computing PTC Mathcad Prime (version 3.1) [2,3]. Note that in this system all nesting arrays are nested matrix. Bibliography: 3 titles.
Keywords: nested array, matrix, tree, recursion, recursive function, decomposition, PTC Mathcad.
@article{CHEB_2015_16_3_a23,
     author = {A. R. Esayan and N. M. Dobrovolsky},
     title = {Nested arrays and recursion},
     journal = {\v{C}eby\v{s}evskij sbornik},
     pages = {479--495},
     publisher = {mathdoc},
     volume = {16},
     number = {3},
     year = {2015},
     language = {ru},
     url = {http://geodesic.mathdoc.fr/item/CHEB_2015_16_3_a23/}
}
TY  - JOUR
AU  - A. R. Esayan
AU  - N. M. Dobrovolsky
TI  - Nested arrays and recursion
JO  - Čebyševskij sbornik
PY  - 2015
SP  - 479
EP  - 495
VL  - 16
IS  - 3
PB  - mathdoc
UR  - http://geodesic.mathdoc.fr/item/CHEB_2015_16_3_a23/
LA  - ru
ID  - CHEB_2015_16_3_a23
ER  - 
%0 Journal Article
%A A. R. Esayan
%A N. M. Dobrovolsky
%T Nested arrays and recursion
%J Čebyševskij sbornik
%D 2015
%P 479-495
%V 16
%N 3
%I mathdoc
%U http://geodesic.mathdoc.fr/item/CHEB_2015_16_3_a23/
%G ru
%F CHEB_2015_16_3_a23
A. R. Esayan; N. M. Dobrovolsky. Nested arrays and recursion. Čebyševskij sbornik, Tome 16 (2015) no. 3, pp. 479-495. http://geodesic.mathdoc.fr/item/CHEB_2015_16_3_a23/

[1] Esayan A. R., Teaching algorithmization based on recursion, TGPU, Tula, 2001, 215 pp. (in Russian)

[2] Maxfield B., Essential PTC Mathcad Prime 3.0. A Guide for New and Current Users, Academic Press is an imprint of Elsevier, New York, Nov. 11, 2013, 563 pp.

[3] Nans Wessenlingh and Hans de Waard, Calculate Communicate with Mathcad Prime 3.0, First edition, Delft Academic Press, The Netherlands, 2014