Problem Detail: I try to construct a TM that accepts the language ${ ww mid w in {a,b}^* }$. Between the words $w$ is no delimeter, so I don’t know, how my TM can know where the first $w$ ends and Read More …
Blog
Connection between KMP prefix function and string matching automaton
Problem Detail: Let $A_P = (Q,Sigma,delta,0,{m})$ the string matching automaton for pattern $P in Sigma^m$, that is $Q = {0,1,dots,m}$ $delta(q,a) = sigma_P(P_{0,q}cdot a)$ for all $qin Q$ and $ain Sigma$ with $sigma_P(w)$ the length of the longest prefix of $P$ Read More …
Difference between end carry and overflow
Problem Detail: I am confused with end carry and overflow. When will an end carry be the overflow? How to identify whether the end carry is overflow or not? Are they both same? Sometimes end carries obtained are simply discarded and Read More …
Average depth of a Binary Search Tree and AVL Tree
Problem Detail: My professor recently mentioned that the average depth of the nodes in a binary search tree will be $O(log(n))$ where $n$ is the amount of nodes in the tree. I ended up drawing out a bunch of binary search Read More …
How to find the minimum number of vertices whose removal make the graph disjoint
Problem Detail: Given a graph $G = (V,E)$. Is there any algorithm which finds the minimum number of vertices to be removed from $G$ so that every vertex in the graph becomes disjoint, i.e., every vertex is disconnected from every other Read More …
Find the minimum amount of swaps to sort array
Problem Detail: When getting source array length, I want to generate the array of swaps that need to be performed in order to sort the source array. I want to make this array as small as possible. Swaps will be performed Read More …
Turing-unrecognizable language – what TM does?
Problem Detail: I have a problem giving “intuitive” explanation to turing-unrecognizable languages. We can prove that, say, ${overline{A_{TM}}}$ is not turing-recognizable, because that would make ${{A_{TM}}}$ decidable, but what would the $TM$ do if it doesn’t accept, reject of loop? Asked Read More …
Complexity of algorithm inserting an element in a circular linked list at the front end
Problem Detail: In a circular linked list, if an elements needs to be inserted at front [just before the node pointed by head], can be done in O(1) (see the answer here) But in a book currently, I have, it is Read More …
Why is using a lexer/parser on binary data so wrong?
Problem Detail: I often work with lexer/parsers, as opposed to a parser combinator and see people who never took a class in parsing, ask about parsing binary data. Typically the data is not only binary but also context sensitive. This basically Read More …
How to prove that problem is not in P
Problem Detail: Given some abstract problem how can I prove that this problem is not in P. I mean, what is the method for proving such thesis? Asked By : Ari Answered By : Yuval Filmus The most common technique is to prove Read More …