Problem Detail: How would you determine big O notation for $log^b x$? I don’t think you can simply say $O(log^b x)$, can you? If you can, then here is a better question: $x^3 + log^b x$. How would you know if Read More …
Category: Uncategorized
[Solved]: Complexity of variation of partition problem
Problem Detail: I want to know whats the complexity of the following variant of the partition problem: Partition problem: http://en.wikipedia.org/wiki/Partition_problem Suppose we have one set formed by integers and we want to partition the set in two subsets of the same Read More …
[Solved]: Chernoff bounds and Monte Carlo algorithms
Problem Detail: One of Wikipedia examples of use of Chernoff bounds is the one where an algorithm $A$ computes the correct value of function $f$ with probability $p > 1/2$. Basically, Chernoff bounds are used to bound the error probability of Read More …
[Solved]: Creating arrays of object of abstract class in statically-typed object-oriented languages
Problem Detail: In statically-typed object-oriented languages (like Java, C++, C#, …), suppose I declare an abstract class: public abstract class myclass1 { …………….. } Most of these languages (like Java) wouldn’t allow us to create an Object of an Abstract class, Read More …
[Solved]: How do I continue learning programming, beyond the basics?
Problem Detail: DISCLAIMER: I understand that I might not be posting in the right part of StackExchange, or this question might have been asked before (I haven’t found it). If this offends anybody, I apologize. I’m 15 and a sophomore in Read More …
[Solved]: (Possibly Easy) Formal Language Question
Problem Detail: I am looking at a “practice test” for a Theory of Computation class. It was a test in a previous year. I am asked to prove that, given L1 and L2 are regular, the union and difference are both Read More …
[Solved]: Is oracle computer capable of doing infinite loops?
Problem Detail: Solve this problem: “build an infinite binary oscilator” With a Turing Machine we can solve it a=False While True: a=not a print a, then output will be True False True False True False … (for ever) I think an Read More …
[Solved]: Mutual exclusion for n processes
Problem Detail: I want to implement mutual exclusion for $n$ processes. Critical section code: int turn = 0; /* shared control variable */ Pi: /* i is 0 or 1 */ while (turn != i) ; /* busy wait */ CSi; Read More …
[Solved]: DFS miniumum spanning tree
Problem Detail: Just a quick question, If i were to alter the general DFS algorithm to do this: minDFS(Vertex v) { if (!v.getVisted()) { v.setVisited(); Vertex temp = findClosestVertex(); graph.addEdge(v, temp); minDFS(temp); } } Would I eventually (at the end of Read More …
[Solved]: What is a compact way to represent a partition of a set?
Problem Detail: There exist efficient data structures for representing set partitions. These data structures have good time complexities for operations like Union and Find, but they are not particularly space-efficient. What is a space-efficient way to represent a partition of a Read More …