6,449 Hits in 7.0 sec

There and back again

Olivier Danvy, Mayer Goldberg
2002 Proceedings of the seventh ACM SIGPLAN international conference on Functional programming - ICFP '02  
Conversely, in a TABA-based function written in continuation-passing style and recursively defined over a data structure (traversed at call time), the continuation acts as an iterator over a second data  ...  The idea is that the recursive calls get us 'there' by traversing the first data structure and the returns get us 'back again' while traversing the second data structure.  ...  Lawall, Kevin Millikin, Henning Korsholm Rohde, Michael Sperber, and the anonymous reviewers for comments.  ... 
doi:10.1145/581478.581500 dblp:conf/icfp/DanvyG02 fatcat:2lhalqf5dbcepmmus4kohqnkrm

There and Back Again

Olivier Danvy, Mayer Goldberg
2005 BRICS Report Series  
Conversely, in a TABA-based function written in continuation-passing style and recursively defined over a data structure (traversed at call time), the continuation acts as an iterator over a second data  ...  The idea is that the recursive calls get us 'there' by traversing the first data structure and the returns get us 'back again' while traversing the second data structure.  ...  This work is partially supported by the ESPRIT Working Group APPSEM ( and by the Danish Natural Science Research Council, Grant no. 21-03-0545.  ... 
doi:10.7146/brics.v12i3.21869 fatcat:76fzqpnvevbyllotg4mffciqem

Efficient reconstruction of binary trees from their traversals

R.D. Cameron, B.K. Bhattacharya, E.A.T. Merks
1989 Applied Mathematics Letters  
Given tbe n nodes of a binary tree in botb inorder and preorder sequence. tbe tree can be uniquely idcntific.d.  ...  An efficient al~oritbm for tumstructing aucb. trees f-their sequences is Lm&:x:sing 0 (n) time and 0 (h) uttermediate storage, whem h IS tbe he&t of tbe tree being  ...  When the dual-order traversal algorithm is reversed from a tree-traversal to a tree-building algorithm, these properties provide the information necessary to decide when the left and/or right subtrees  ... 
doi:10.1016/0893-9659(89)90122-5 fatcat:i6hoihelpbffzigkusp726fcxm

A constrained recursion algorithm for batch normalization of tree-sturctured LSTM [article]

Ruo Ando, Yoshiyasu Takefuji
2020 arXiv   pre-print
In this paper, we propose a novel recursive algorithm for traversing batch normalized tree-structured LSTM.  ...  However, there have been few research efforts on the hyperparameter tuning of the construction and traversal of tree-structured LSTM.  ...  Finally, a derived class may define additional members beyond those it inherits from its base class. C. Recursion and binary tree of LSTM Recursion is a fundamental process in different modalities.  ... 
arXiv:2008.09409v1 fatcat:qjuf2luxpjfz3k4qrsd7gbtie4

Design patterns as higher-order datatype-generic programs

Jeremy Gibbons
2006 Proceedings of the 2006 ACM SIGPLAN workshop on Generic programming - WGP '06  
types); by the element type (a type); and by the body of the computation, which is a higher-order argument (a value, typically a function).  ...  We argue the case by presenting higher-order datatype-generic programs capturing Origami, a small suite of patterns for recursive data structures.  ...  An earlier version appeared as a workshop paper [26] , and some of the material was also incorporated into lecture notes from a Spring School [27] .  ... 
doi:10.1145/1159861.1159863 dblp:conf/icfp/Gibbons06 fatcat:pust3qdcejcnnd6hzskhalleea

Isomorphic Interpreters from Logically Reversible Abstract Machines [chapter]

Roshan P. James, Amr Sabry
2013 Lecture Notes in Computer Science  
Concretely, we develop several simple interpreters over numbers and addition, move on to tree traversals, and finish with a meta-circular interpreter for our reversible language.  ...  This paper remedies this aspect by presenting a systematic technique for developing a large and expressive class of reversible recursive programs, that of logically reversible smallstep abstract machines  ...  This material is based upon work supported by the National Science Foundation under Grant No. 1116725.  ... 
doi:10.1007/978-3-642-36315-3_5 fatcat:nyo3j65gufeuvfvbcwegothzpe

Rebuilding a Tree from Its Traversals: [chapter]

Shin-Cheng Mu, Richard Bird
2003 Lecture Notes in Computer Science  
Given the inorder and preorder traversal of a binary tree whose labels are all distinct, one can reconstruct the tree.  ...  We also present a new, although complicated, algorithm by trying another possibility not explored before.  ...  Acknowledgement The converse-of-a-function theorem was first proposed by Oege de Moor [4, 11] .  ... 
doi:10.1007/978-3-540-40018-9_18 fatcat:kux37f4dtrbvbfsd7ba6jydneu

On the recursion depth of special tree traversal algorithms

Peter Kirschenhofer, Helmut Prodinger
1987 Information and Computation  
An inverse of q is obtained by reversing the recursive process in the definition of q Now it is easy to prove by induction that q maps %& onto Y$,+ ]. 1 We are now ready to establish the local expansion  ...  We establish a bijection $: Vh + s+, in the following way: In the lirst step we map a tree t with n nodes and FIGURE 2 U(I) <It to a binary tree $'(t) with n -1 nodes and A*($'(?)) <A.  ...  from the left between z and O. (In our example the sequence of areas is 1, 3, 2, 1, corresponding to Fig. 6, and 1, 3 , 2, 1 is also the sequence of heights of the leaves of the tree in Fig. 7 .  ... 
doi:10.1016/0890-5401(87)90009-5 fatcat:4urdfgbdwnc5zgmbf7cbuq2sjm

Recursion patterns and time-analysis

Manuel Barbosa, Alcino Cunha, Jorge Sousa Pinto
2005 SIGPLAN notices  
Even though time analysis is not compositional, we argue that splitting functions to expose the explicit construction of the recursion tree and its later consumption helps with this analysis.  ...  Recursion Patterns in a Nutshell Folds. A classic example of a situation where a recursive pattern can be used is given by any function that iterates an arithmetic operator over a list of numbers.  ...  Acknowledgments This research was partially supported by FCT research project Pure POSI/CHS/44304/2002.  ... 
doi:10.1145/1071221.1071226 fatcat:mv2nsbs26vfzlfo64twvvoqx5a

Datatype-Generic Programming [chapter]

Jeremy Gibbons
2007 Lecture Notes in Computer Science  
We use it to mean polytypism, that is, parametrization by the shape of data structures rather than their contents.  ...  The term means different things to different people: parametric polymorphism, data abstraction, meta-programming, and so on.  ...  The effect of the reversal is that elements of the tree are traversed 'from right to left', which we consider to be a reasonable, if rather odd, definition of traverse.  ... 
doi:10.1007/978-3-540-76786-2_1 fatcat:qulchjxhw5hjrau7vjsbhhhtx4

Performance Analysis of Zippers [article]

Vít Šefl
2019 arXiv   pre-print
We attempt to address this issue by comparing the performance of zippers and mutable pointers in two common scenarios and three different languages: C++, C#, and Haskell.  ...  It is often used in cases where the imperative data structures would use a mutable pointer. However, the efficiency of zippers as a replacement for mutable pointers is not sufficiently explored.  ...  Binary tree and its zipper Listing 2 defines a binary tree and its zipper. Listing 3 shows how to move the focus of this zipper to the parent node.  ... 
arXiv:1908.10926v1 fatcat:tbbtqpjxezadnb5uxs3qmx7oae

On The Solution Of The Towers Of Hanoi Problem

Hayedeh Ahrabian, Comfar Badamchi, Abbass Nowzari-Dalini
2011 Zenodo  
In this paper, two versions of an iterative loopless algorithm for the classical towers of Hanoi problem with O(1) storage complexity and O(2n) time complexity are presented.  ...  Based on this algorithm the number of different moves in each of pegs with its direction is formulated.  ...  ACKNOWLEDGMENT This research was partially supported by University of Tehran.  ... 
doi:10.5281/zenodo.1076655 fatcat:f2d4uros6jf37mv4egwwr5vo3a

Nonprocedural programming [chapter]

B. M. Leavenworth
1975 Lecture Notes in Computer Science  
The conventional representation of an algorithm as a step by step sequential procedure often obscures the essential nature of the procedure.  ...  The elimination of certain low level features of traditional programming and their replacement by these and other techniques (associative referencing, aggregate operators and pattern matching) is advocated  ...  We also include in this category most iterative and recursive constructions.  ... 
doi:10.1007/3-540-07131-8_34 fatcat:rheybtimjzfihieobdor7qrhr4

In-place Heap Construction with Optimized Comparisons, Moves, and Cache Misses [chapter]

Jingsen Chen, Stefan Edelkamp, Amr Elmasry, Jyrki Katajainen
2012 Lecture Notes in Computer Science  
Our main idea is to mimic the Gonnet-Munro algorithm by converting a navigation pile into a binary heap.  ...  To construct a binary heap in-place, we use this algorithm to build bottom heaps of size Θ(lg n) and adjust the heap order at the upper levels using Floyd's sift-down procedure.  ...  To initialize a navigation pile, we traverse the tree bottom-up level by level and update the navigation information at each node by comparing the elements referred to by its children.  ... 
doi:10.1007/978-3-642-32589-2_25 fatcat:laqctkvlzvbkjl7p6cjpxbvon4

Steps towards mechanizing program transformations using PVS

Natarajan Shankar
1996 Science of Computer Programming  
The first is a fusion theorem due to Bird where the composition of a catamorphism (a recursive operation on the structure of a datatype) and an anamorphism (an operation that constructs instances of the  ...  The second example is Wand's continuation-based transformation technique for deriving tail-recursive functions from non-tailrecursive ones.  ...  , and the former constructs a list by an in-order traversal of the resulting tree.  ... 
doi:10.1016/0167-6423(96)00003-2 fatcat:6lpnqvgtwng3xer5gs7r5m7fqa
« Previous Showing results 1 — 15 out of 6,449 results