complexity-theory
minimum distance between 2 points in c++
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)[详细]
2023-03-08 19:12 分类:问答What is the "maximal" size (complexity) of a DB query that is tractable in practice in your RDBMS? [closed]
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[详细]
2023-03-07 19:22 分类:问答Where can I use a technique from Majority Vote algorithm
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.[详细]
2023-03-07 18:25 分类:问答Longest non decrease subseq in Haskell is slow. How to improve?
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][详细]
2023-03-07 15:51 分类:问答Best algorithm for delete duplicates in array of strings
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):[详细]
2023-03-07 12:31 分类:问答How to measure complexity of a string?
I have a few long strings (~ 1.000.000 chars). Each string only contains symbols from the defined alphabet, for example[详细]
2023-03-07 06:52 分类:问答group similar documents
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,[详细]
2023-03-06 23:26 分类:问答complexity of combinatorial function
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[详细]
2023-03-06 14:15 分类:问答How hard is this in terms of computational complexity?
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[详细]
2023-03-06 11:21 分类:问答String to string correction problem np-completeness proof
I have this assignment to prove that this problem: Finite alphabet £, two strings x,y € £*, and a positive integer K.Is[详细]
2023-03-06 09:51 分类:问答