Problem Detail: I’m trying to understand this dynamic programming related problem, adapted from Kleinberg’s Algorithm Design book. Not homework: i’ve already a solution, just considering if i’m ok with the theory. Suppose we want to replicate a file over a collection Read More …
Category: Uncategorized
[Solved]: What does up arrow ($uparrow$) mean in pseudocode?
Problem Detail: I’m learning vantage point trees, and I met this while reading the paper Data Structures and Algorithms for Nearest Neighbor Search in General Metric Spaces by Peter Yianilos (Proceedings of SODA 1993, SIAM, pages 311–321; PDF). The following pseudocode Read More …
[Solved]: kd-tree stores points in inner nodes? If yes, how to search for NN?
Problem Detail: The link in wikipedia about kd-trees store points in the inner nodes. I have to perform NN queries and I think (newbie here), I am understanding the concept. However, I was said to study Kd-trees from Computational Geometry Algorithms Read More …
[Solved]: Algorithm for sorting with constraints
Problem Detail: I’ve got 30 elements which has to be grouped/sorted into 10 ordered 3-tuple. There are several rules and constraints about grouping/sorting. For example: Element $A$ must not be in the same tuple same unit $B$. Element $C$ must not Read More …
[Solved]: Reference request: optimizing procedures on lists in dynamic languages by performing safety checks in advance
Problem Detail: For my science fair project, I implemented an optimization to Python’s sort routine. The idea is to move the safety checks that have to be carried out during each comparison, e.g. type checks and character-width checks, outside of the Read More …
[Solved]: Suboptimal Solution for a combinatorial problem
Problem Detail: I have a cost function $f(X)=|hat{X}-X|_2$ to minimize which depends on a $stimes s$ matrix $X$ where $hat{X}$ is given and $|X|_2=big(sum_{i,j}x_{ij}^2big)^{1/2} $. This matrix $X$ is generated by selecting only $s$ different rows from a matrix $B$ of 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 …
[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]: 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]: 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 …