Problem Detail: As Wikipedia says, quickSort needs O(log n) extra space when the following conditions are met: In-place partitioning is used. This unstable partition requires O(1) space. After partitioning, the partition with the fewest elements is (recursively) sorted first, requiring at Read More …
Category: Uncategorized
[Solved]: Which addressing modes permits relocation without any change whatsoever in the code?
Problem Detail: An exercise problem stated that : Which of the following addressing modes permits relocation without any change whatsoever in the code? Indirect addressing Indexed addressing Base register addressing PC relative addressing Somewhere it explained as : Base register addressing Read More …
[Solved]: Implementing addition for a binary counter
Problem Detail: A binary counter is represented by an infinite array of 0 and 1. I need to implement the action $text{add}(k)$ which adds $k$ to the value represented in the array. The obvious way is to add 1, k times. Read More …
[Solved]: Longest cycle contained in two cycles
Problem Detail: Is the following problem NP-complete? (I assume yes). Input: $k in mathbb{N},G=(V,E)$ an undirected graph where the edge set can be decomposed into two edge-disjoint simple cycles (these are not a part of the input). Question: Is there a Read More …
[Solved]: How do I reconstruct the forest of syntax trees from the Earley vector?
Problem Detail: Using the Earley vector as a recognizer is quite straightforward: when the end of the string is reached, you just have to check for a completed axiomatic production started at position 0. If you have at least one, then Read More …
[Solved]: Finding the two largest of five small integers as quickly as possible
Problem Detail: I use a variation of a 5-cross median filter on image data on a small embedded system, i.e. x x x x x The algorithm is really simple: read 5 unsigned integer values, get the highest 2, do some Read More …
[Solved]: Data Flow Analysis with exceptions
Problem Detail: Data flow analysis work over a control flow graph. When a language under consideration supports exceptions, control flow graph can explode. What are the standard techniques for dealing with this blow-up? Can we soundly disregard edges induced by exception? Read More …
[Solved]: Is an irregular language concatenated with a language with which it has no common symbols irregular?
Problem Detail: Here’s an example of what I’m talking about. Suppose I have a languages $$ L_{1} = {a^ib^i mid i>0}, L_{2} = {c^i mid i>0} $$ and $$ L_{1}L_{2} = {a^ib^ic^i mid i>0} $$ Is it true that if $L_{1}$ Read More …
[Solved]: Bellman-Ford: shortest path
Problem Detail: my assumption: – we have an undirected graph with only positive edges – the edges are sorted alphabetically: e.g A-B, A-C, B-D and e.g not C-A, D-B, A-B I do not understand, why we need the first loop (line Read More …
[Solved]: Problems that are Cook-reducible to a problem in NP $cap$ co-NP
Problem Detail: Let $mathcal{A}$ be a problem in $text{NP} cap text{co}$-$text{NP}$. Now assume we can reduce another problem $mathcal{B}$ to it using Cook reduction. What conclusions can we draw about $mathcal{B}$? Does this question even make sense? I’m asking because from Read More …