Top "Recursion" questions

Recursion is a kind of function call in which a function calls itself.

Recursive function to generate multidimensional array from database result

I'm looking to write a function that takes an array of pages/categories (from a flat database result) and generates …

php arrays function recursion
git add -A is not adding all modified files in directories

I want to add all files no matter what: whether it is deleted, created, modified, untracked, etc? I just don't …

git recursion
Reversing a linkedlist recursively in c

The following code works fine when head is sent as a parameter to it. As I am new to C, …

c recursion linked-list singly-linked-list
javascript: recursive anonymous function?

Let's say I have a basic recursive function: function recur(data) { data = data+1; var nothing = function() { recur(data); } nothing(); } How …

javascript recursion scope anonymous-function
Recursion in Angular directives

There are a couple of popular recursive angular directive Q&A's out there, which all come down to one …

javascript recursion angularjs
PHP tree structure for categories and sub categories without looping a query

I'm trying to create a list of categories with any number of sub categories, where sub categories can also has …

php arrays recursion tree multidimensional-array
One-liner to recursively list directories in Ruby?

What is the fastest, most optimized, one-liner way to get an array of the directories (excluding files) in Ruby? How …

ruby filesystems recursion
Convert a series of parent-child relationships into a hierarchical tree?

I have a bunch of name-parentname pairs, that I'd like to turn into as few heirarchical tree structures as possible. …

php recursion tree
How to calculate the depth of a binary search tree

I would like to calculate the summation of the depths of each node of a Binary Search Tree. The individual …

java recursion binary-search-tree
Fibonacci sequence in Ruby (recursion)

I'm trying to implement the following function, but it keeps giving me the stack level too deep (SystemStackError) error. Any …

ruby recursion fibonacci