I\'m given m places (x,y coordinates). I have n requests of finding the closest place to a given point P(x,y); (The minimum Euclidian distance)
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
As seen in the answers to Linear time majority algorithm?, it is possible to compute the majority of an array of elements in linear time and log(n) space.
longest\'inc\'subseq seq = maximum dp where dp = 1 : [val n | n <- [1..length seq - 1]] val n = (1 +) . filter\'and\'get\'max ((<= top) . (seq!!)) $ [0..pred n]
Today at school the teacher asked us to implement a duplicate-deletion algorithm. It\'s not that difficult, and everyone came up with the following solution (pseudocode):
I have a few long strings (~ 1.000.000 chars). Each string only contains symbols from the defined alphabet, for example
This question relates to grouping/clustering similar documents in Information Retrieval. I have a set of documents, D1, D2, .. Dn. For each document, Di, I also have a set of keywords, Di_k1, Di_k2,
How the complexity of an algorithm involved with combinatorial operations is classified. Let\'s say the input is m, n, and the complexity is determined by C(m,n). (C is the combination function of c
So I have a problem that is basically like this: I have a bunch of strings, and I want to construct a DAG such that every path corresponds to a string and vice versa. However, I have the freedom to pe
I have this assignment to prove that this problem: Finite alphabet £, two strings x,y € £*, and a positive integer K.Is