Problem Detail: What’s the fundamental difference(s) between small and big-step operational semantics? I’m having a hard time grasping what it is and the motivation for having the two. Asked By : Simon Morgan Answered By : Gilles Small-step semantics defines a method to Read More …
Category: Uncategorized
Finding the median in a heap
Problem Detail: Given a binary heap $H$, indexed in $[1..n]$, whose elements are integers, is there a way to quickly find its median in $O(log n)$-time? Asked By : Cássio Jandir Pagnoncelli Answered By : jbapple It takes $Omega(n)$ time to find the Read More …
Show that Vertex-Cover is NP-complete, using Stable-Set
Problem Detail: My task is to give proof, the Vertex-Cover problem is NP-complete, assuming it’s already shown that the Stable-Set problem is NP-complete, too. My approach: i know, Stable-Set is NP-complete, and all Problems that are NP-complete can be reduced to Read More …
How to use a greedy algorithm to find the non-decreasing sequence closest to the given one?
Problem Detail: You are given n integers $a_1, ldots, a_n$ all between $0$ and $l$. Under each integer $a_i$ you should write an integer $b_i$ between $0$ and $l$ with the requirement that the $b_i$’s form a non-decreasing sequence. Define the Read More …
What problem does cache coloring solve?
Problem Detail: According to what I have read from two different sources, cache coloring is (was?) required in order to: Counter the problem of aliasing: Prevent two different virtual addresses with the same physical address from mapping to different cache sets. Read More …
Star free language vs. regular language
Problem Detail: I was wondering, since $a^*$ is itself a star-free language, is there a regular language that is not a star-free language? Could you give an example? (from wikipdia) Lawson defines star-free languages as: A regular language is said to Read More …
Upper Bound on Runtime of Memoized DP Algorithms
Problem Detail: I find it fairly easy to generate an upper bound for nearly any iterative solution (e.g. look at the limits on each loop, etc.), and can oftentimes create an upper bound for normal recursive functions. However, I am now Read More …
What are the possible sets of word lengths in a regular language?
Problem Detail: Given a language $L$, define the length set of $L$ as the set of lengths of words in $L$: $$mathrm{LS}(L) = {|u| mid u in L }$$ Which sets of integers can be the length set of a regular Read More …
Matrix Chain Multiplication Greedy Approach
Problem Detail: In the question Matrix Chain Multiplication you are given a chain of Matrices and is required to find the optimal way to multiply the matrices together. Normally this is solved using Dynamic Programming but I have found a greedy Read More …
Find an MST in a graph with edge weights from {1,2}
Problem Detail: I’ve been asked the following question: Given a connected undirected graph $G=(V,E)$ and a weight function $w: E to {1,2}$, suggest an efficient algorithm that finds an MST of the graph. After a few clarifications, the algorithm should run Read More …