Is (pure) functional programming antagonistic with “algorithm classics”?

With respect to data structures, Chris Okasaki has done substantial research into adopting classic data structures into a purely functional setting, as many of the standard data structures no longer work when using destructive updates. His book “Purely Functional Data Structures” shows how some structures, like binomial heaps and red/black trees, can be implemented quite … Read more

Use of indexes for multi-word queries in full-text search (e.g. web search)

As you said some-word -> [doc385, doc211, doc39977, …] (sorted by rank, descending), I think the search engine may not do this, the doc list should be sorted by doc ID, each doc has a rank according to the word. When a query comes, it contains several keywords. For each word, you can find a … Read more

Are there any good / interesting analogs to regular expressions in 2d?

Not being a regex expert, but finding the problem interesting, I looked around and found this interesting blog entry. Especially the syntax used there for defining the 2D regex looks appealing. The paper linked there might tell you more than me. Update from comment: Here is the link to the primary author’s page where you … Read more

Youtube content identification technology?

Pedro Moreno and others at Google/Youtube work on it. They use finite-state transducers to recognize sequences of music phone units, similar to phonemes in automatic speech recognition. Check out this article: Eugene Weinstein, Pedro J. Moreno; Music Identification with Weighted Finite-State Transducers, Proceedings of the International Conference in Acoustics, Speech and Signal Processing (ICASSP), 2007. … Read more

How to optimally divide an array into two subarrays so that sum of elements in both are same, otherwise give an error?

There exists a solution, which involves dynamic programming, that runs in O(n*TotalSum), where n is the number of elements in the array and TotalSum is their total sum. The first part consists in calculating the set of all numbers that can be created by adding elements to the array. For an array of size n, … Read more