Most Popular
1500 questions
12
votes
1 answer
Solving T(n) = 2T(n/2) + log n with the recurrence tree method
I was solving recurrence relations. The first recurrence relation was
$T(n)=2T(n/2)+n$
The solution of this one can be found by Master Theorem or the recurrence tree method. The recurrence tree would be something like this:
The solution would be:…

RajS
- 1,667
- 4
- 26
- 46
12
votes
0 answers
Optimal meeting point in directed graph
Let $G(V, E)$ be a edge-weighted directed connected graph and $v_1, \dots, v_n \in V$ be some vertices. Let $d(a, b)$ denote the length of the shortest path from $a$ to $b$, for $a,b \in V$.
I need to find a vertex $v \in V$ such that $$\sum_{i=1}^n…

vojta
- 221
- 1
- 4
12
votes
2 answers
Is this special case of a scheduling problem solvable in linear time?
Alice, a student, has a lot of homework over the next weeks. Each item of homework takes her exactly one day. Each item also has a deadline, and a negative impact on her grades (assume a real number, bonus points for only assuming comparability),…

Matthias
- 129
- 8
12
votes
1 answer
Google DeepDream Elaborated
I've seen a few questions on this site about Deep Dream, however none of them seem to actually speak as to what DeepDream is doing, specifically. As far as I've gathered, they seem to have changed the objective function, and also changed…

Bob
- 121
- 3
12
votes
7 answers
How to find middle element of linked list in one pass?
One of the most popular question from data structures and algorithm, mostly asked on telephonic interview.
user49842
12
votes
2 answers
A* graph search time-complexity
Some confusion about time-complexity and A*.
According to
A* Wiki the time-complexity is exponential in the depth of the solution (shortest path):
The time complexity of A* depends on the heuristic. In the worst case of an unbounded search space,…

User
- 530
- 1
- 3
- 15
12
votes
3 answers
Regular languages that can't be expressed with only 2 regex operations
I thought all regular languages could be expressed with regular expressions (if a language is regular, it can be expressed with regex), but
I have been told that you need all three of the regular operations (concatenation, union, and star) for that…

user3295674
- 383
- 4
- 14
12
votes
2 answers
Is Post Correspondence Problem in NP?
I just read some pages in Sipser's book Introduction to Theory of Computation about Post Correspondence Problem, and I'm thinking that PCP is actually in NP. The certifier is: for an input configuration of pile
$$(t_1/b_1,…

phhoang
- 125
- 1
- 6
12
votes
1 answer
Finding a minimal cover of a subset of a finite cartesian product by cartesian products
Given a subset of a cartesian product $I \times J$ of two finite sets, I wish to find a minimal cover of it by sets which are cartesian products themselves.
For example, given a product between $I=\{A,B,C\}$ and $J=\{1,2,3\}$, I may observe the…

yuvalm2
- 223
- 1
- 5
12
votes
2 answers
Is there a generalization of Huffman Coding to Arithmetic coding?
In trying to understand the relationships between Huffman Coding, Arithmetic Coding, and Range Coding, I began to think of the shortcomings of Huffman coding to be related to the problem of fractional bit-packing.
That is, suppose you have 240…

Realz Slaw
- 6,191
- 32
- 71
12
votes
1 answer
NP-hardness of covering with rectangular pieces (Google Hash Code 2015 Test Round)
The Google Hash Code 2015 Test Round (problem statement) asked about the following problem:
input: a grid $M$ with some marked squares, a threshold $T \in \mathbb{N}$, a maximal area $A \in \mathbb{N}$
output: the largest possible total area of a…

a3nm
- 222
- 3
- 9
12
votes
1 answer
Prove that the complement of $\{0^n1^n \mid n \geq{} 0\}$ is not regular using closure properties
I want to prove that the complement of $\{0^n1^n \mid n \geq{} 0\}$ is not regular using closure properties.
I understand pumping lemma can be used to prove that $\{0^n1^n \mid n \geq{} 0\}$ is not a regular language. I also understand regular…

anthony34234
- 121
- 1
- 3
12
votes
2 answers
Why is least fixed point (lfp) important in program analysis
I am trying to get a big picture on the importance of least fixed point (lfp) in program analysis. For instance abstract interpretation seems to use the existence of lfp. Many research papers on program analysis also focus heavily on finding least…

Ram
- 223
- 2
- 5
12
votes
2 answers
Minimal Spanning Tree With Double Weight Parameters
Consider a graph $G(V,E)$. Each edge $e$ has two weights $A_e$ and $B_e$. Find a spanning tree that minimizes the product $\left(\sum_{e \in T}{A_e}\right)\left(\sum_{e \in T}{B_e}\right)$. The algorithm should run in polynomial time with respect to…

Strin
- 1,505
- 1
- 11
- 16
12
votes
1 answer
Edit distance of list with unique elements
Levenshtein-Distance edit distance between lists
is a well studied problem.
But I can't find much on possible improvements if
it is known that no element does occurs more than once in each list.
Let's also assume that the elements are…

user362178
- 221
- 1
- 5