Problem Detail: If I have a Type 3 Grammar, it can be represented on a pushdown automaton (without doing any operation on the stack) so I can represent regular expressions by using context free languages. But can I know if a Read More …
Category: Uncategorized
Time complexity of a triple nested loop with squared indices
Problem Detail: I have seen this function in past year exam paper. public static void run(int n){ for(int i = 1 ; i * i < n ; i++){ for(int j = i ; j * j < n ; j++){ Read More …
Good way to describe co-RE (co-recursively enumerable)?
Problem Detail: I get that R is a set of languages that are decidable by a Turing Machines And that RE is a set of languages that a each language can be recognized by a TM, that is the machine will Read More …
Print bottom view of a binary tree
Problem Detail: For a binary tree we define horizontal distance as follows: Horizontal distance(hd) of root = 0 If you go left then hd = hd(of its parent)-1, and if you go right then hd = hd(of its parent)+1. The bottom Read More …
Practical applications of disjoint set datastructure
Problem Detail: I know that the disjoint set datastructure is used to keep track of the connected components of an undirected graph when the edges are added to the graph dynamically . I also know that is is used in Kruskal’s Read More …
How does interpreting a script work?
Problem Detail: Suppose I have a script (.vbs, for example) that is stored in a file. How does the code in the file get converted into machine instructions? What is between the vbs file and the processor? Asked By : developer747 Answered Read More …
Can a semi-decidable problem be also decidable?
Problem Detail: As far as I understand, a semi-decidable (recursively enumerable) problem could be: decidable (recursive) or undecidable (nonrecursively enumerable) This post made me wonder if this is not conventionally followed. This is my answer to it and as far as Read More …
Is a stack overflow detected by hardware or software?
Problem Detail: Is it the task of the software (operating system) to detect stack overflows or is a stack overflow detected in hardware, causing an exception in the CPU? Asked By : gilianzz Answered By : Gilles It can be software, or hardware, Read More …
Undecidable unary languages (also known as Tally languages)
Problem Detail: An exercise that was in a past session is the following: Prove that there exists an undecidable subset of ${1}^*$ This exercise looks very strange to me, because I think that all subsets are decidable. Is there a topic Read More …
Running time – Linked Lists Polynomial
Problem Detail: I have developed two algorithms and now they are asking me to find their running time. The problem is to develop a singly linked list version for manipulating polynomials. The two main operations are addition and multiplication. In general Read More …