Problem Detail: In Don Knuth’s famous series of books, The Art of Computer Programming, section 2.3.1, he describes an algorithm to traverse binary tree in inorder, making use of an auxiliary stack: T1 [Initialize.] Set stack $rm A$ empty and set Read More …
Blog
[Solved]: Which part of the computer allocates memory in RAM?
Problem Detail: When we declare a variable there will be a random part of memory will be allocated in RAM. Which component will allocate the memory? Is the processor or any other specific hardware doing the allocation? Asked By : sivashanmugam kannan Read More …
[Solved]: Difference between the languages accepted by two DFAs with different initial state/accepting states?
Problem Detail: Recently, I asked a question on Math SE. No response yet. This question is related to that question, but more technical details toward computer science. Given two DFAs $A = (Q, Sigma, delta, q_1, F_1)$ and $B = (Q, Read More …
[Solved]: proving $P subseteq PCP(0,O(log(n))$
Problem Detail: I was working on proving this one and I’ve solve one direction as follows : to prove that $P subseteq PCP(0,logn)$ I said : let $M$ be deterministic polynomial TM that accepts $L in P$ ,we want to show Read More …
[Solved]: Simulating a TM with a 2-head, right moving TM
Problem Detail: Is it possible to simulate a regular Turing Machine with a TM with the following specs? There are two heads, one of which can read, one of which can write Both heads can only move right When a head Read More …
[Solved]: Is lambda calculus suitable for expressing semantics of non-functional languages?
Problem Detail: Would it be convenient to express semantics of imperative languages (e.g. C) and object-oriented languages (e.g. Java) with $lambda$-calculus? Or in the other words: is $lambda$-calculus a suitable candidate for expressing semantics of all context-sensitive languages? Asked By : Petr Read More …
[Solved]: Finding maximal factorization of regular languages
Problem Detail: Let language $mathcal{L} subseteq Sigma^*$ be regular. A factorization of $mathcal{L}$ is a maximal pair $(X,Y)$ of sets of words with $X cdot Y subseteq mathcal{L}$ $X neq emptyset neq Y$, where $X cdot Y = {xy$ | $x Read More …
[Solved]: Prove correctness of recursive algorithm
Problem Detail: I have this java function: public int foo(ArrayList l, int n) { if(n <= 1) return l.get(0); if(l.get(0) < l.get(1)) l.remove(1); else l.remove(0); foo(l, n-1); } So I figure to show that the algorithm is correct I would use Read More …
[Solved]: How does a computer play a video while doing something else?
Problem Detail: How is video playback done on a computer? It’s obviously not relying purely on the CPU, since video playback continues when a user performs another activity, such as typing into a YouTube comment field. This task seems further complicated Read More …
[Solved]: I want to pursue a career in computer programming. Where do I start?
Problem Detail: I am currently finishing up my junior year as a Biochemistry major at a 4-year university. In a year, I will graduate with a B.S. in Biochemistry and way more credit hours than anyone should ever have due to Read More …