Problem Detail: I’m reading Homer and Selman’s “Computability and Complexity” book. In some Corollary 5.3 it says: For all ε > 0, DTIME(O(n)) = DTIME( (1+ε) n). Now I’m confused with this corollary and Rosenberg’s result (p87 in the same book): Read More …
Author: ignougroup
[Solved]: Polymorphism and Inductive datatypes
Problem Detail: I’m curious. I’ve been working on this datatype in OCaml: type ‘a exptree = | Epsilon | Delta of ‘a exptree * ‘a exptree | Omicron of ‘a | Iota of ‘a exptree exptree Which can be manipulated using Read More …
[Solved]: Since we need space for recursive calls, is the space complexity of the recursive factorial is n?
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 …
[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]: 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]: Which NPC problems are NP Hard
Problem Detail: I have read that TSP and Subset Sum problems are NPC problems which are also NP Hard. There are also problems like Halting Problem which is NP Hard, but not NP Complete And Wikipedia defines this as A problem 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 …