recursion
Walk array recursively and print the path of the walk
Can someone help me with some code or instructions on how to walk recursively an array and when reaching the last element print the full path to it? A simple echo will work because I will adapt the co[详细]
2023-04-08 22:34 分类:问答I/O hangs after recursive pipe() calls
This is a followup to my previous question. I am writing a linux shell, and so I need to deal with the possibility of users inputting multiple pipe commands. It is almost working correctly, except for[详细]
2023-04-08 21:22 分类:问答How to create a Prouhet–Thue–Morse sequence in Haskell?
I\'m a noob in Haskell, but some experience with ActionScript 3.0 Object Orientated. Thus working on a major programming transition. I\'ve read the basic knowledge about Haskel, like arithmetics. And[详细]
2023-04-08 17:41 分类:问答How to call a method n times in Scala?
I have a case where I want to call a method n times, where n is an Int. Is there a good way to do this in a \"functional\" way in Scala?[详细]
2023-04-08 11:42 分类:问答recursion through hashes in ruby
I\'m doing a bit of recursion through hashes to build attr_accessor and class instances. I get all of the value from a main hash.[详细]
2023-04-08 11:03 分类:问答Recursive function for building array from tree
I have an array that looks like this: Array ( [0] => Array ( [term_id] => 23 [name] => testasdf [depth] => 1[详细]
2023-04-08 09:38 分类:问答Finding by Recursion Sequences of Characters in a Char Array
I have a recursion project to find all the sequences(or subsets) of a Char array as such that each character appears in the same order.For Example, for the array Char[] letters = {\'A\', \'B\',\'C\',\[详细]
2023-04-08 09:14 分类:问答Error out of bounds exception when running recursive program in Java
I\'m learning about recursion as part of a Java tutorial and I am looking for a littlehelp. We need to make a recursive Java program which will work out how to get from one city to the other when the[详细]
2023-04-08 06:15 分类:问答get a recursive parent list
Using MySQL, I want to return a list of parents, from a table that has a field structure like this. ID,PARENTID,NAME (a standard parent-child hierarchy). I would like to traverse \"up\" the tree to re[详细]
2023-04-08 05:43 分类:问答Why is the complexity of computing the Fibonacci series 2^n and not n^2?
I am trying to find complexity of Fibonacci series using a recursion tree and concluded height of tree = O(n) worst case, cost of each level = cn, hence complexity = n*n=n^2[详细]
2023-04-08 02:30 分类:问答