Problem Detail: In the bounded Integer Knapsack problem, we are given N items of sizes S1 through SN, having values V1 through VN. The problem requires us to find the maximum value that can be attained for a given capacity C, Read More …
Category: Uncategorized
[Solved]: Building static hash table with particular collisions
Problem Detail: Is there efficient algorithm to encode keys in hash function with provided collisions? By efficient I mean with low-ish runtime of lookup operation (taking constants into account) and realistic time of finding such function. Keys are floating point Read More …
[Solved]: Not understand exchanging argument proof for optimal prefix code
Problem Detail: I am currently reading the Algorithm Design textbook by Kleinberg and Tardos and I am having difficulty understanding a proof using an exchange argument Statement: A binary tree corresponding to the optimal prefix code is full Proof: This is Read More …
[Solved]: baz_num_elts exercise from Software Foundations
Problem Detail: I’m at the following exercise in Software Foundations: (** **** Exercise: 2 stars (baz_num_elts) *) (** Consider the following inductive definition: *) Inductive baz : Type := | x : baz -> baz | y : baz -> bool Read More …
[Solved]: How to obtain a trilateration ordering in a graph?
Problem Detail: In a sensor network graph $G = (V,E)$ $V = {1,2,…,n}$ is the set of sensors and the edge $(i,j)$ denotes that sensor $i$ and sensor $j$ are inside each other’s sensing range. The weight of that edge denotes Read More …
[Solved]: Can you reduce a precedence graph or do *all* relevant nodes need to be connected
Problem Detail: Let’s say we have the following simple transaction-schedule: T1 | T2 | T3 —–+——+—– w(x)| | | w(x) | | | w(x) T1 comes before T2, so in the precedence graph, we draw an arrow from T1 to T2. Read More …
[Solved]: How to reduce from subset-sum problem?
Problem Detail: I have this problem which is described as follows: Input: You are given a multi-set $M$ (a set that can contain duplicates), and two numbers $P$ and $T$. $M = {(x_1,y_1), (x_2,y_2), …, (x_n,y_n)}$. Each $x$ and $y$ is Read More …
[Solved]: DFA with limited states
Problem Detail: Lets $L_z := { a^i b^i c^i : 0 leq i < z }$ ${a,b,c} in sum^*$ there is a DFA with $frac{z(z+1)}{2}+1$ states – How can I prove this? And I need largest possible number $n_z$, for which Read More …
[Solved]: Why multiple return values is not a common thing?
Problem Detail: I would like to ask a question about multiple return values, why this construct is not preferrable in programming languages (conceptual and/or technical difficulties). I’ve heard something about stack frames and how they reserve memory for return value and Read More …
[Solved]: How many edges can a unipathic graph have?
Problem Detail: A unipathic graph is a directed graph such that there is at most one simple path from any one vertex to any other vertex. Unipathic graphs can have cycles. For example, a doubly linked list (not a circular one!) Read More …