Problem Detail: I have an assignment where I need to make use a binary search tree and alter it to self order itself such that items that are accessed the most (have a higher priority) are at the top of the Read More …
Blog
[Solved]: Are Java and C# also purely interpreted languages?
Problem Detail: I was wondering about the nature of these managed languages i-e since c# and java both are converted into intermediate language and byte code respectively, and are interpreted by their respective runtime(s). So if they are somehow pure interpreted Read More …
[Solved]: Arbitrary precision integer square root algorithm?
Problem Detail: Are there any known subquadratic algorithms for calculating the floor of the square root of an n bit integer? The naive algorithm would be something like def sqrt(x): r = 0 i = x.bit_length() // 2 while i >= Read More …
[Solved]: How is this problem related to the study of algorithms and big O notation?
Problem Detail: I’m taking a graduate computer science course on algorithms and analysis. The current subject is big O notation and recursion. How is the following problem related to the study of algorithms, recursion, and big O notation? I know and Read More …
[Solved]: Average length of s-t (simple) paths in a directed graph
Problem Detail: Given the fact that $s$-$t$ path enumeration is a #P-complete problem, could there be efficient methods that compute (or at least approximate) the average length of $s$-$t$ path without enumerating them? What if paths are allowed to revisit vertices? Read More …
[Solved]: What’s the definition of a (deterministic) formal language?
Problem Detail: Definitions According to my UML teacher formal means strictly according to rules, officially and how it’s supposed to be. He says a formal language = syntax + symbols + spelling. Another term he uses is deterministic. According to him Read More …
[Solved]: Turing recognizable & decidable: binary strings with even length. Let A = {(M) | M is a DFA such that L(M) is not the same as EVEN}
Problem Detail: Having trouble with this homework problem. In order to show that A is Turing recognizable and decidable. $text{EVEN} = text{binary strings with even length}$ $Let;A = {(M) | ,M; text{is a DFA such that L(M) is not the same Read More …
[Solved]: Deciding if a Turing machine has made a left move
Problem Detail: In writing a decider for a machine to see if it has made a left move or not on an input of w, it is said that if we continue the computation for $|w|+N+1$ ($N$ : number of states) Read More …
[Solved]: How does Grover’s Quantum Sorting avoid reading the list?
Problem Detail: It is well known now that Grover’s quantum algorithm can SORT a database of $N$ entries in $O(sqrt{N})$ time. How can an algorithm work without reading through the list of entries which needs $O(N)$ operation. How does Grover’s algorithm Read More …
[Solved]: reducing subset-sum to partition
Problem Detail: Subset-sum: Given a list of numbers, find if a non-empty sublist has sum 0 (there’s a variation where we want sum=k instead of 0, but 0 is easier for analysis) Partition: Given a list, can it be partitioned Read More …