Problem Detail: I’m looking to improve my object-oriented design skills and I came across a problem which asked to design classes to represent a mathematical expression such as (a + b) * ( c – d / e) in memory so Read More …
Author: ignougroup
Negative numbers in Subset-Sum
Problem Detail: If I have a set $A$ with positive and negative numbers, and a number to find C. It is possible to reduce the problem to one with only positive numbers in set $A$? I mean, it is possible to Read More …
When does the nearest neighbor heuristic fail for the Traveling Salesperson?
Problem Detail: Can you provide an example of NN algorithm failure on the Euclidean traveling salesman problem? I was trying to construct a specific example of this for my friends and was failing. Asked By : dylan Answered By : Karolis Juodelė Consider Read More …
How can one simulate a PDA with a FIFO queue PDA?
Problem Detail: I’m trying to figure out how a pushdown automata (PDA), which we know uses a stack (LIFO) can be simulated by a queue (FIFO). I understand that in a regular PDA, we only have access to the top most Read More …
Is there C++ code that takes infinite time to compile?
Problem Detail: Is C++ as a formal language recursively enumerable? If yes, is there any invalid C++ code that takes “infinite” time to compile? Asked By : sai_preet Answered By : Bartosz Przybylski In theory this code should compile infinitely template<long long K> Read More …
The Gas Station Problem – fast implementation
Problem Detail: Recently I was asking about the algorithm to solve The Gas Station Problem and I got useful answer. Unfortunately solution with transforming a graph to complete graph and then preparing another one to find the shortest path (as described Read More …
Advantage of byte addressable memory over word addressable memory
Problem Detail: What is the reason that almost all computers (besides some DSPs) use byte addressable memory? With byte addressable memory and a 32 bit address you can have 4GB while with word addressable memory you can have 4GB * wordsize. Read More …
3-dimensional matching approximation algorithm (implementation details)
Problem Detail: I have a run-time implementation question regarding the 3-dimensional (unweighted 2-)approximation algorithm below: How can I construct the maximum matching M_r in S_r in linear time in line 8? $X, Y, Z $ are disjoint sets; a matching $M$ Read More …
How can I debug my pseudocode algorithm?
Problem Detail: The algorithms for the problem I am working on become more and more complex as I try to improve their performance. They already span several pages with cases and sub-cases, and will probably become even longer. I am worried Read More …
Prove that all non-recursive languages are infinite
Problem Detail: I am wondering this statement above [the title] is true or not. Here is what I’ve already had : non-recursive means undecidable. I’ve read this Are all infinite languages undecidable? which says: If a Language is undecidable(non-recursive), there must Read More …