Skip to main content

Questions tagged [time-complexity]

The amount of time resources (number of atomic operations or machine steps) required to solve a problem expressed in terms of input size. If your question concerns algorithm analysis, use the [runtime-analysis] tag instead. If your question concerns whether or not a computation will *ever* finish, use the [computability] tag instead. Time-complexity is perhaps the most important sub-topic of complexity theory.

3 votes
2 answers
117 views

I just solved the following Leetcode problem: All Paths From Source to Target Here is my solution: ...
Platus's user avatar
  • 127
3 votes
3 answers
186 views

Fibonacci string is a sequence of strings defined by $F_1 = \mathtt{a}$, $F_2 = \mathtt{b}$, and $F_{n+2} = F_{n}F_{n+1}$ (concatenation). For example, $F_3 = \mathbb{ab}$, $F_4 = \mathbb{bab}$, etc. ...
Richard's user avatar
  • 33
2 votes
1 answer
227 views

Consider an instance of the knapsack problem: there are some $n$ items, each with a value and a cost. We should choose a subset of items with total cost at most $C$, and subject to that, with a ...
Erel Segal-Halevi's user avatar
2 votes
1 answer
91 views

Hi I was wondering whether there is a tighter bound on the time complexity in the following theorem: $$ \mathrm{DSPACE}(f(n)) \subseteq \mathrm{DTIME}\left(2^{O(\log n+f(n))}\right). $$ In particular, ...
Jip Helsen's user avatar
0 votes
0 answers
5 views

I am looking into Sat Solvers and I have subproblems which I know are renamable Horn Sat. Was wondering if I can speed up my solutions by using unit directly on renamable Horn Sat rather than reduce ...
Charles Mahon's user avatar
2 votes
1 answer
50 views

Hi I was looking at a proof and in the proof it is used that SAT can be reduced CNF-SAT, in polynomial time. If I am correct this is accomplished through a Tseytin transformation, the wikipedia ...
Jip Helsen's user avatar
1 vote
1 answer
20 views

I was wondering when converting a Turing Machine machine into a corresponding oblivious Turing machine, how efficiently the oblivious equivalent can be run in function of T(n) the maximum number of ...
Jip Helsen's user avatar
1 vote
0 answers
21 views

Hi I was wondering for a universal (deterministic) turing machine $U_{TM}$ that simulates a pair $<TM,\sigma>$ with $\sigma \in \Sigma^*$ with $T(n)$ the number of steps $TM$ takes when run on $\...
Jip Helsen's user avatar
0 votes
0 answers
73 views

Given: 3 positive integers $a$, $b$, $L$. Problem: Is there a positive integer $x \leq L$ such that $x^2 \equiv a \pmod b$? This problem remains NP-complete (AN1 G&J) even if the factorization of ...
TheoryQuest1's user avatar
1 vote
1 answer
52 views

This may seem like a pedantic or trivial question but it's something that's been irking me since working through some problems in a competitive programming manual. One of the problems dealt with ...
bishop-fish's user avatar
0 votes
2 answers
45 views

To find out if a tree is a subtree of another, there is an O(m*n) complexity solution that I'm aware of, that looks a bit like: ...
narutosister's user avatar
0 votes
1 answer
52 views

Given arbitrarily large (but not infinite) memory is it possible to compute and store every possible output for every possible input beforehand thus making the program run in constant time?
MushroomTea's user avatar
0 votes
0 answers
22 views

Let $W\neq\varnothing$ be a finite set of states and $\partial:W\rightarrow[0,1]$ a (rational) probability distribution on it. The size of $\partial$ is the number of non-zero terms in it. E.g., for $...
Daniil Kozhemiachenko's user avatar
2 votes
0 answers
74 views

I have a long array of size $n>10^6$, call it $X$. I would like to find all ranges $[a, b)$ satisfying the following conditions $\sum_{i=a}^{b-1}X[i] \leq 0$, $b-a \geq K$, $\sum_{i=a-1}^{b-1} X[i]...
cebir latis's user avatar
4 votes
1 answer
92 views

Given a finite field of order $2^{\lambda}$ (where $\lambda$ isn't integral), what's the time complexity of finding any solution of the equation $ax^2+bx+c=0$ in the said finite field? The best ...
DannyNiu's user avatar
  • 450

15 30 50 per page
1
2 3 4 5
183