Problem Detail: Given two binary search trees T1 and T2, if it is possible to obtain T2 from T1 using only right-rotation, we say that T1 can be right-converted to T2. For example, given three binary search tree T1, T2 and Read More …
Category: Uncategorized
[Solved]: Why are the two farthest points vertices of the Convex Hull?
Problem Detail: I read that in a 2D space, the two points farthest away must be in the convex hull (CH). Intuitively, I can see why. If the two farthest points are not in the convex hull, then there must be Read More …
[Solved]: Data structures as algorithms themselves
Problem Detail: Can data structures be thought of as algorithms themselves? For example, I could implement a stack data structure that has certain non-functional characteristics. Is the separation between data structures and algorithms formally defined? Asked By : Ben Aston Answered By Read More …
[Solved]: What are examples of inconsistency and incompleteness in Unix/C?
Problem Detail: In Richard Gabriel’s famous essay The Rise of Worse is Better, he contrasts caricatured versions of the MIT/Stanford (Lisp) and New Jersey (C/Unix) design philosophies along the axes of simplicity, correctness, consistency, and completeness. He gives the example of Read More …
[Solved]: Clever memory management with constant time operations?
Problem Detail: Let’s consider a memory segment (whose size can grow or shrink, like a file, when needed) on which you can perform two basic memory allocation operations involving fixed size blocks: allocation of one block freeing a previously allocated block Read More …
[Solved]: How to explain the steps in the implementation of hashing functions like SHA1
Problem Detail: I was reading the article about the SHA1 hashing function (I know it is not secure anymore) and I’ve found a pseudocode implementation on Wikipedia. I can see that there are a lot of mathematical operations, and what I Read More …
[Solved]: Why does Schaefer’s theorem not prove that P=NP?
Problem Detail: This is probably a stupid question, but I just don’t understand. In another question they came up with Schaefer’s dichotomy theorem. To me it looks like it proves that every CSP problem is either in P or in NP-complete, Read More …
[Solved]: Factorial usage within proof using the pumping lemma
Problem Detail: We are going over the pumping lemma in class and we recently went over the following example: Let $$ L = { w mid w text{ has a different number of 0s and 1s} } $$ Consider $$ s Read More …
[Solved]: Syntax of a Pushdown Automata transition function
Problem Detail: I just learned PDAs in class today, but am having problems understanding the syntax of the transition function. Could someone please explain to me the meaning of this syntax: $delta(q, lambda, S) = {(q, aaB), (q, bbA)}$ This is Read More …
[Solved]: What does sublinear space mean for Turing machines?
Problem Detail: The problem of deciding whether an input is a palindrome or not has been proved to require $Omega(log n)$ space on a Turing machine. However, even storing the input takes space $n$ so doesn’t that mean that all Turing machines Read More …