It uses recursion to to implement quicksort. For the purpose of partitioning pivot is chosen according to median-of-three scheme.
errperf(T,P,M) uses T and P, which are target and prediction vectors respectively, and returns the value for M, which is one of several error related performance metrics.
T and P can be row or column vectors of the same size. M can be...
pic shows recursion level of 7
this takes a few min to compute
Uses a recursion relation to generate all the binomial coefficients nchoosek(n,k) for a range n<=nmax, k<= n. This is much faster than using nchoosek to make this table.
The idea of this function is to be used when you have to...
Will produce a figure of an n bit Gray Code shaft encoder and a gray code table
Straightforward program. Gray code is produced by recursion and the disk is drawn using patch objects
This function is a sudoku puzzle solver that uses a recursive algorithm described below.
Step 1. Take a standard sudoku puzzle in matrix form with all the blank spots filled with zeros. For example, you could type
This is an updated version of Super Sudoku game with an improved solver. More puzzles now can be solved without recursion and more quickly.
For those, who are interested in to see what have been changed, this version is submitted...
converts numbers to alphabetical numbers
A short engine for testing against a regex, understanding the 3 common quantifiers
?,+,* (non-greedy) working on characters, ., [...], [^...], s, S, bracketed patterns and group designators N. Accepts unicode objects and fixed-width encoded...
A simple brute-force Sudoku solver written in functional-programming style. This code is not aimed for speed, the goal is to write a clear, compact and (hopefully) pedagogical functional solution.
This script recursively scans a given path and applies a cleaning 'action'
to matching files and folders. By default files and folders matching the
specified (.endswith) patterns are deleted. Alternatively, _quoted_ glob
When files and directories need to be securely deleted, there are many tools in existence that people can turn to for their needs. While there are many ways one might go about manually deleting files and removing directories, this recipe provides...
This recipes demonstrates how to use recursive generator to implement permutation and combination.
This code, when passed a MATLAB structure, will recursively go into it and print out the form of the struct.
This is a simple state machine that takes a functional approach.
It requires trampoline from pysistence.func to avoid the recursion limit.
Namedtuples are used to define the different states.
globals() is used to reference the...
This procedure was proposed as a challenge to Python and other languages as the most concise coding. See Icon programming on the web. This is a lazy, recursive generator. It can be implemented several ways in Python with lists, iteration, and...
This script is placed in a location then run. All files underneath the root will be propagated to the top level, while deleting any old directory's.
Problems: If you have large files in nested folders you will be copying them multiple...
Minimalistic Memoization in python, just works, doesn't take care of cleaning up the cache however.
Snippet of code that uses recursion to print nested dictionaries.
It does not sort the entries!