Wolfram: Recursion
Nest (Recursion)
NestWhile
NestWhile-
Like
Nest, but with a condition when to stop.NestWhile has a lot options, controlling when to stop, what arguments to feed to the test function. See documentation.
NestWhile[ Function[{x}, x + 1], 1, Function[Mod[#, 5] =!= 0] ] (* 5 *) NestWhileList-
Like
NestWhilebut return a list of all steps.NestWhileList[ Function[{x}, x + 1] , 1, Function[Mod[#, 5] =!= 0] ] (* {1, 2, 3, 4, 5} *)
FixedPoint (Stop when result is the same)
FixedPoint-
Recursion of a function until result no longer changes. Optionally with a max number of steps.
see real life examples:
FixedPointList-
Like
FixedPointbut return a list of all steps.
Recursion of function with 2 args
Wolfram. List Operations, and Loop, Iteration, Recursion
- Wolfram: List Operations
- Wolfram: List. Create (Table)
- Wolfram: Create Flat List (Range)
- Wolfram: List. Get Parts
- Wolfram: List. Add Element
- Wolfram: List. Delete Element
- Wolfram: List. Change Element
- Wolfram: List. Check Exist
- Wolfram: List. Join, Union, Intersection, Difference
- Wolfram: List. Min, Max
- Wolfram: List. Filter
- Wolfram: List. Sort Reverse Ordering
- Wolfram: Flatten
- Wolfram: Riffle (Add at Every Nth)
- Wolfram: RotateLeft
- Wolfram: Padding
- Wolfram: List. Partition, Reshape, Split, Gather
- Wolfram: Transpose
- Wolfram: List. Same Items Counts, Tally, Group
- Wolfram: List. Combinatorics
- Wolfram: Iteration
- Wolfram: Map Function to List
- Wolfram: Scan (foreach)
- Wolfram: Recursion
- Wolfram: Fold (reduce)
- Wolfram: Loop