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 …
Category: Uncategorized
[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]: Looking for a set implementation with small memory footprint
Problem Detail: I am looking for implementation of the set data type. That is, we have to maintain a dynamic subset $S$ (of size $n$) from the universe $U = {0, 1, 2, 3, dots , u – 1}$ of size Read More …
[Solved]: What are the applications of Rose trees?
Problem Detail: I recently found out about the Rose tree data structure, but just going off of a Haskell data definition and the tiny Wikipedia description of it, I’ve got some trouble understanding what applications a Rose tree might have. For Read More …
[Solved]: Data structure to insert, update and sort indexes by frequency and query an index for a particular cumulative frequency
Problem Detail: Here is the description of the data structure I am looking for: Initial Original Data Index | Frequency | 1 3 2 1 3 7 4 2 5 6 Now it should be kept Sort-ed by their frequency inside Read More …
[Solved]: What is the expected number of nodes at depth d of a tree after i random insertions
Problem Detail: Suppose one wanted to build a tree at random. Let the first insertion at step $i = 1$ be the root node. From here, nodes are inserted into the tree at random one at a time. How would one Read More …
[Solved]: Finite automaton – language acceptance
Problem Detail: In the book “The New Turing Omnibus”, an excercise reads as the follows: “Show that no finite automaton can accept the language consisting of all words of the form $a^n b^n, n=1,2,3,…$ The formula represents $n$ a’s followed by 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 …