<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Publishing DTD v1.3 20210610//EN" "JATS-journalpublishing1-3.dtd">
<article article-type="research-article" dtd-version="1.3" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xml:lang="ru"><front><journal-meta><journal-id journal-id-type="publisher-id">cheb</journal-id><journal-title-group><journal-title xml:lang="ru">Чебышевский сборник</journal-title><trans-title-group xml:lang="en"><trans-title>Chebyshevskii Sbornik</trans-title></trans-title-group></journal-title-group><issn pub-type="ppub">2226-8383</issn><publisher><publisher-name>Tula State Lev Tolstoy  Pedagogical University</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.22405/2226-8383-2015-16-3-479-495</article-id><article-id custom-type="elpub" pub-id-type="custom">cheb-225</article-id><article-categories><subj-group subj-group-type="heading"><subject>Research Article</subject></subj-group><subj-group subj-group-type="section-heading" xml:lang="ru"><subject>Статьи</subject></subj-group><subj-group subj-group-type="section-heading" xml:lang="en"><subject>Article</subject></subj-group></article-categories><title-group><article-title>ГНЕЗДОВЫЕ МАССИВЫ И РЕКУРСИЯ</article-title><trans-title-group xml:lang="en"><trans-title>NESTED ARRAYS AND RECURSION</trans-title></trans-title-group></title-group><contrib-group><contrib contrib-type="author" corresp="yes"><name-alternatives><name name-style="eastern" xml:lang="ru"><surname>Есаян</surname><given-names>А. Р.</given-names></name><name name-style="western" xml:lang="en"><surname>Esayan</surname><given-names>A. R.</given-names></name></name-alternatives><xref ref-type="aff" rid="aff-1"/></contrib><contrib contrib-type="author" corresp="yes"><name-alternatives><name name-style="eastern" xml:lang="ru"><surname>Добровольский</surname><given-names>Н. М.</given-names></name><name name-style="western" xml:lang="en"><surname>Dobrovolsky</surname><given-names>N. M.</given-names></name></name-alternatives><xref ref-type="aff" rid="aff-1"/></contrib></contrib-group><aff xml:lang="ru" id="aff-1"><institution>Тульский государственный педагогический университет им. Л. Н. Толстого.</institution><country>Russian Federation</country></aff><pub-date pub-type="collection"><year>2015</year></pub-date><pub-date pub-type="epub"><day>06</day><month>07</month><year>2016</year></pub-date><volume>16</volume><issue>3</issue><fpage>479</fpage><lpage>495</lpage><permissions><copyright-statement>Copyright &amp;#x00A9; Есаян А.Р., Добровольский Н.М., 2016</copyright-statement><copyright-year>2016</copyright-year><copyright-holder xml:lang="ru">Есаян А.Р., Добровольский Н.М.</copyright-holder><copyright-holder xml:lang="en">Esayan A.R., Dobrovolsky N.M.</copyright-holder><license xml:lang="ru" license-type="creative-commons-attribution" xlink:href="https://creativecommons.org/licenses/by/4.0/" xlink:type="simple"><license-p>Данная работа распространяется под лицензией Creative Commons Attribution 4.0.</license-p></license><license xml:lang="en" license-type="creative-commons-attribution" xlink:href="https://creativecommons.org/licenses/by/4.0/" xlink:type="simple"><license-p>This work is licensed under a Creative Commons Attribution 4.0 License.</license-p></license></permissions><self-uri xlink:href="https://www.chebsbornik.ru/jour/article/view/225">https://www.chebsbornik.ru/jour/article/view/225</self-uri><abstract><p>Решение задач с данными, представленными вложенными или, по- другому, гнездовыми массивами, является непростым делом из-за достаточно непредсказуемой их структуры. И здесь во многих случаях спасительной оказывается рекурсия. Ее использование позволяет линейно по одной и той же схеме осуществлять пробежку по всем элементам каждого уровня любого гнездового массива вне зависимости от его структуры и глубины вложенности. Гнездовой массив можно интерпретировать деревом, корнем которого является сам массив, от него идут дуги к массивам- элементам и т. д. Листьями подобного дерева являются скаляры или строки — конечные элементы, не имеющие ссылок на последующие массивы. В статье для решения ряда задач общего характера с гнездовыми массивами предлагаются соответствующие рекурсивные программы-функции. Вот примеры таких задач: подсчитать общее количество листьев массива; сформировать массив из транспонированных на всех уровнях вложенности элементов исходного массива; выяснить, является ли данный объект (скаляр, строка, простой массив, гнездовой массив) элементом данного массива на каком-либо уровне вложенности; подсчитать количество вхождений объекта в массив на всех уровнях вложенности; собрать все листья массива в вектор, заместить листья данного массива элементами какого-либо вектора и т. п. Во всех случаях рекурсивная триада такова: параметр рекурсии — гнездовой массив; декомпозиция — переходы на всех уровнях вложенности от массивов к их элементам и так до листьев; рекурсивная база, то есть тривиальные случаи в рекурсии — листья массивов [<xref ref-type="bibr" rid="cit1">1</xref>]. Предлагаемые лаконичные рекурсивные программы-функции решения перечисленных и некоторых других задач реализованы на простом и интуитивно понятном языке программирования системы инженерных и научных вычислений PTC Mathcad Prime (версия 3.1) [2,3]. Отметим, что в этой системе гнездовые массивы — это вложенные друг в друга матрицы.</p><p> </p></abstract><trans-abstract xml:lang="en"><sec><title>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.</title></sec><sec><title></title></sec></trans-abstract><kwd-group xml:lang="ru"><kwd>гнездовой массив</kwd><kwd>матрица</kwd><kwd>дерево</kwd><kwd>рекурсия</kwd><kwd>рекурсивная функция</kwd><kwd>декомпозиция</kwd><kwd>PTC Mathcad</kwd></kwd-group><kwd-group xml:lang="en"><kwd>nested array</kwd><kwd>matrix</kwd><kwd>tree</kwd><kwd>recursion</kwd><kwd>recursive function</kwd><kwd>decomposition</kwd><kwd>PTC Mathcad.</kwd></kwd-group></article-meta></front><back><ref-list><title>References</title><ref id="cit1"><label>1</label><citation-alternatives><mixed-citation xml:lang="ru">Есаян А. Р. Обучение алгоритмизации на основе рекурсии. Тула: Изд. ТГПУ, 2001, с. 215</mixed-citation><mixed-citation xml:lang="en">Esayan, A. R. 2001, "Obuchenie algoritmizacii na osnove rekursii." , [Teaching algorithmization based on recursion], TGPU, Tula, 215 pp. (Russian)</mixed-citation></citation-alternatives></ref><ref id="cit2"><label>2</label><citation-alternatives><mixed-citation xml:lang="ru">Brent Maxfield, P. E. Essential PTC Mathcad Prime 3.0. A Guide for New and Cur-rent Users, New York, Academic Press is an imprint of Elsevier, Nov. 11, 2013, p. 563</mixed-citation><mixed-citation xml:lang="en">Brent Maxfield, P. E. 2013, Essential PTC Mathcad Prime 3.0. A Guide for New and Cur-rent Users, Academic Press, New York.</mixed-citation></citation-alternatives></ref><ref id="cit3"><label>3</label><citation-alternatives><mixed-citation xml:lang="ru">Нans Wessenlingh and Hans de Waard. Calculate &amp; Communicate with Mathcad Prime 3.0, Delft Academic Press, The Netherlands, First edition 2014.</mixed-citation><mixed-citation xml:lang="en">Wessenlingh, Н. &amp; de Waard, H. 2014, Calculate &amp; Communicate with Mathcad Prime 3.0, Delft Academic Press, The Netherlands</mixed-citation></citation-alternatives></ref><ref id="cit4"><label>4</label><citation-alternatives><mixed-citation xml:lang="ru"></mixed-citation><mixed-citation xml:lang="en"></mixed-citation></citation-alternatives></ref></ref-list><fn-group><fn fn-type="conflict"><p>The authors declare that there are no conflicts of interest present.</p></fn></fn-group></back></article>
