Top "Recursion" questions

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

Finding height in Binary Search Tree

I was wondering if anybody could help me rework this method to find the height of a binary search tree. …

algorithm recursion binary-search-tree
Determining complexity for recursive functions (Big O notation)

I have a Computer Science Midterm tomorrow and I need help determining the complexity of these recursive functions. I know …

recursion big-o complexity-theory
Is log(n!) = Θ(n·log(n))?

I am to show that log(n!) = Θ(n·log(n)). A hint was given that I should show the upper …

algorithm math recursion complexity-theory big-o
How to find all combinations of coins when given some dollar value

I found a piece of code that I was writing for interview prep few months ago. According to the comment …

algorithm recursion puzzle coin-change
What is recursion and when should I use it?

One of the topics that seems to come up regularly on mailing lists and online discussions is the merits (or …

recursion computer-science
Python: Maximum recursion depth exceeded

I have the following recursion code, at each node I call sql query to get the nodes belong to the …

python recursion max depth tree-traversal
Reversing a linked list in Java, recursively

I have been working on a Java project for a class for a while now. It is an implementation of …

java data-structures recursion linked-list
What is tail call optimization?

Very simply, what is tail-call optimization? More specifically, what are some small code snippets where it could be applied, and …

algorithm recursion language-agnostic tail-recursion tail-call-optimization
Recursive sub folder search and return files in a list python

I am working on a script to recursively go through subfolders in a mainfolder and build a list off a …

python list recursion os.walk
How to get all files under a specific directory in MATLAB?

I need to get all those files under D:\dic and loop over them to further process individually. Does MATLAB …

matlab file recursion file-io directory