algorithm

Similarity between line strings

I have a number of tracks recorded by a GPS, which more formally can be described as a number of line strings. Now, some of the recorded tracks might be recordings of the same route, but because of inaccurasies in the GPS system, the fact that the recordings were made on separate occasions and that they might have been recorded travelli...

What is a good non-recursive algorithm for deciding whether a passed in amount can be built additively from a set of numbers?

What is a non recursive algorithm for deciding whether a passed in amount can be built additively from a set of numbers. In my case I'm determining whether a certain currency amount (such as $40) can be met by adding up some combination of a set of bills (such as $5, $10 and $20 bills). That is a simple example, but the algorithm needs...

C# compare algorithms

Hi, Are there any open source algorithms in c# that solve the problem of creating a difference between two text files? It would be super cool if it had some way of highlighting what exact areas where changed in the text document also. ...

How Do You Categorize Based On Text Content?

How does one automatically find categories for text based on content? ...

What is a good algorithm for deciding whether a passed in amount can be built additively from a set of numbers?

What is a good algorithm for deciding whether a passed in amount can be built additively from a set of numbers. In my case I'm determining whether a certain currency amount (such as $40) can be met by adding up some combination of a set of bills (such as $5, $10 and $20 bills). That is a simple example, but the algorithm needs to work fo...

Is there an algorithm that extracts meaningful tags of english text

I would like to extract a reduced collection of "meaningful" tags (10 max) out of an english text of any size. http://tagcrowd.com/ is quite interesting but the algorithm seems very basic (just word counting) Is there any other existing algorithm to do this? ...

A/B testing on a news site to improve relevance

If you were running a news site that created a list of 10 top news stories, and you wanted to make tweaks to your algorithm and see if people liked the new top story mix better, how would you approach this? Simple Click logging in the DB associated with the post entry? A/B testing where you would show one version of the algorithm tog...

Algorithm for finding characters in the same positions in a list of strings?

Suppose I have: Toby Tiny Tory Tily Is there an algorithm that can easily create a list of common characters in the same positions in all these strings? (in this case the common characters are 'T' at position 0 and 'y' at position 3) I tried looking at some of the algorithms used for DNA sequence matching but it seems most of them ...

Given an unsigned int, what's the fastest way to get the "indexes" of the set bits?

So for e.g. 0110 has bits 1 and 2 set, 1000 has bit 3 set 1111 has bits 0,1,2,3 set ...

Using Stack as Queue

Suppose we have two stacks and no other temporary variable . Is to possible to use it as a queue provided we have associated API i.e push,pop for stack and insert and remove for queue operations. ...

How to programmatically normalize music tags?

Suppose I have a large and legal collection of music that has been inconsistently tagged. I want to normalise a single field, eg Artist, so that, for example, the following artists all become the one artists: the Grateful Dead the gratefull dead grateful dead grateful dead, The So... should I be looking at trying to match against a ...

How to read values from numbers written as words?

As we all know numbers can be written either in numerics, or called by their names. While there are a lot of examples to be found that convert 123 into one hundred twenty three, I could not find good examples of how to convert it the other way around. Some of the caveats: cardinal/nominal or ordinal: "one" and "first" common spelling ...

Why is quicksort better than mergesort?

I was asked this question during an interview. They're both O(nlogn) and yet most people use Quicksort instead of Mergesort. Why is that? ...

How do I compare phrases for similarity?

When entering a question, stackoverflow presents you with a list of questions that it thinks likely to cover the same topic. I have seen similar features on other sites or in other programs, too (Help file systems, for example), but I've never programmed something like this myself. Now I'm curious to know what sort of algorithm one would...

Open-source radix/mtrie implementation in C?

I intend to use RADIX / MTRIE as my preferred data-structure for a routing implementation. I would like to know if there's a decent open source implementation available (apart from freebsd-net) which I can use for my purpose, or do I need to write one myself. ...

Best source for Algorithms?

I have the book "Introduction to Algorithms" by by Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, Clifford Stein. What are the other books/sources for algorithms? Even I would like to know information on communities where discussion about Algorithms happen. ...

How to implement a Digg-like algorithm?

Hi, How to implement a website with a recommendation system similar to stackoverflow/digg/reddit? I.e., users submit content and the website needs to calculate some sort of "hotness" according to how popular the item is. The flow is as follows: Users submit content Other users view and vote on the content (assume 90% of the users only...

Recursion or Iteration?

Is there a performance hit if we use loop instead of recursion or vice versa in algorithms where both can serve the same purpose? Eg : Check if given string is palindrome. I have seen many programmers using recursion as a means to show off when a simple iteration algorithm can fit the bill. Does the compiler play a vital role in deciding...

How to remove these kind of symbols (junk) from string?

Imagine I have String in C#: "I Don’t see ya.." I want to remove (replace to nothing or etc.) these "’" symbols. How do I do this? ...

Clustering Algorithm for Mapping Application

I'm looking into clustering points on a map (lat/longs). Are there any recommendations as to a suitable algorithm that is fast and scalable? ...