tagged [recursion]

Recursive List Flattening

Recursive List Flattening I could probably write this myself, but the specific way I'm trying to accomplish it is throwing me off. I'm trying to write a generic extension method similar to the others ...

10 Sep at 18:57

Count Number of 1's in A Binary Representation of N, RECURSIVELY. in JAVA

Count Number of 1's in A Binary Representation of N, RECURSIVELY. in JAVA I understand the concept that the number of 1's in N is the same as N/2 if it's even, and N/2 + 1 if the number is odd, but I ...

9 Sep at 04:33

Way to go from recursion to iteration

Way to go from recursion to iteration I've used recursion quite a lot on my many years of programming to solve simple problems, but I'm fully aware that sometimes you need iteration due to memory/spee...

Recursive call - Action lambda

Recursive call - Action lambda What am I doing wrong here? How can I execute my action? I'm getting a red squiggly when calling `recurse` saying . I've accepted Homam's answer. I'd just like to add/sh...

26 Oct at 23:53

Recursive referencing the same class

Recursive referencing the same class In my case I stared to use ServiceStack... I created a class on the output of servicestack via rest --> I get this ``` {"aText":"String","d":{"aText":"String","d":...

Linq extension method, how to find child in collection recursive

Linq extension method, how to find child in collection recursive I'm already familiar with Linq but have little understanding of extension methods I'm hoping someone can help me out. So I have this hi...

Why doesn't .NET/C# optimize for tail-call recursion?

Why doesn't .NET/C# optimize for tail-call recursion? I found [this question](https://stackoverflow.com/questions/340762/which-languages-support-tail-recursion-optimization) about which languages opti...

23 May at 12:17

Recursive LINQ query: select item and all children with subchildren

Recursive LINQ query: select item and all children with subchildren Is there any way to write a LINQ (or procedural style) query, that can select an item and all children with one query? I have entity...

14 Apr at 08:35

How do I convert a doubly recursive method to a loop?

How do I convert a doubly recursive method to a loop? Here is my simplified doubly recursive method. It does nothing useful, but illustrates the required recursive invocations: ``` void Main() { Tes...

16 Jan at 19:51

Renci SSH.NET: Is it possible to create a folder containing a subfolder that does not exist

Renci SSH.NET: Is it possible to create a folder containing a subfolder that does not exist I am currently using Renci SSH.NET to upload files and folders to a Unix Server using SFTP, and creating dir...

12 Apr at 07:4

Find number of files with a specific extension, in all subdirectories

Find number of files with a specific extension, in all subdirectories Is there a way to find the number of files of a specific type without having to loop through all results inn a Directory.GetFiles(...

13 May at 11:43

C# implementation of deep/recursive object comparison in .net 3.5

C# implementation of deep/recursive object comparison in .net 3.5 I am looking for a C# specific , open source (or source code available) implementation of recursive, or deep, object comparison. I cur...

8 Oct at 20:10

What is the correct way to use async/await in a recursive method?

What is the correct way to use async/await in a recursive method? What is the correct way to use async/await in a recursive method? Here is my method: ``` public string ProcessStream(string streamPosi...

How to do recursive descent of json using json.net?

How to do recursive descent of json using json.net? I am trying to parse a json file using json.net. The file looks like this I am trying to recurse down this structure processing all objects with a T...

Is there a way to make this slideshow move automatically?

Is there a way to make this slideshow move automatically? This is the slideshow that we used: [http://www.littlewebthings.com/projects/blinds/](http://www.littlewebthings.com/projects/blinds/) and thi...

LINQ recursion function?

LINQ recursion function? Let's take this n-tier deep structure for example: If I am looking to get a particular Item by ID (anywhere in the structure) is there some LINQ goodness I can use t

27 Jan at 08:43

List files recursively in Linux CLI with path relative to the current directory

List files recursively in Linux CLI with path relative to the current directory This is similar to [this question](https://stackoverflow.com/questions/105212/linux-recursively-list-all-files-in-a-dire...

23 May at 11:47

Stop the recursion completely when returning something

Stop the recursion completely when returning something I do recursion to find a long value within a List with multiple children that also can have children. following method: ``` public TaxonomyData g...

5 May at 07:15

Recursion with yield return elements order in tree

Recursion with yield return elements order in tree I have a recursive function that returns all subtree nodes, given the starting root node. For the following tree structure: ``` A | +--B | +--C | | |...

Detect Recursive calls in C# code

Detect Recursive calls in C# code I want to find all recursive calls in my code. If I open file in Visual Studio, I get "Recursive call" icon on left side of Editor. ![enter image description here](ht...

Is recursion ever faster than looping?

Is recursion ever faster than looping? I know that recursion is sometimes a lot cleaner than looping, and I'm not asking anything about when I should use recursion over iteration, I know there are lot...

25 Oct at 00:32

What is a catamorphism and can it be implemented in C# 3.0?

What is a catamorphism and can it be implemented in C# 3.0? I'm trying to learn about catamorphisms and I've read [the Wikipedia article](http://en.wikipedia.org/wiki/Catamorphism) and the first coupl...

How do I break out of a loop in Scala?

How do I break out of a loop in Scala? How do I break out a loop? How do I turn nested for loops in

2 Nov at 22:35

Factorial using Recursion in Java

Factorial using Recursion in Java I am learning Java using the book Java: The Complete Reference. Currently I am working on the topic Recursion. There are similar questions on stackoverflow. I searche...

18 Nov at 13:52

Is it possible to implement a recursive "SelectMany"?

Is it possible to implement a recursive "SelectMany"? As we all know, `Enumerable.SelectMany` flattens a sequence of sequences into a single sequence. What if we wanted a method that could flatten seq...

16 Nov at 08:39