Problem Detail: The question is: Given an array of size N, arr, create another array whose index i = number of elements in sub-array(arr, i+1, N-1) that are greater than arr[i]. Eg. if input array is, 5 3 9 8 2 Read More …
Category: Uncategorized
[Solved]: Why do we have to trade abstraction for speed?
Problem Detail: Why can high-level languages seemingly never reach lower-level languages in terms of speed? Examples of high-level languages would be Python, Haskell, and Java. Low-level languages would be trickier to define, but let’s say C. Comparisons can be found all Read More …
[Solved]: Intrinsic matrices in stereo camera calibration
Problem Detail: Suppose I have two cameras, c1 and c2, observing the same scene. I can now Calibrate each camera independently (e.g., with MATLAB’s Camera Calibration App) Calibrate both cameras simultaneously (e.g., with MATLAB’s Stereo Camera Calibration App). Interestingly, the values Read More …
[Solved]: Circles covering a rectangular, how to verify it?
Problem Detail: This may be basic to some of you, but excuse my inexperience with comp. geometry: Given a set of $n$ circles with centers $(x_i, y_i)$ for $1 leq i leq n$ and each having radii $r$. Also given a Read More …
[Solved]: Building a finite state transducer
Problem Detail: I know it’s possible to build a Finite State Transducer for converting numbers from base 2 to base 4 or 8 or other powers of 2 (translating from base N to base N^M is easy). However I’ve never seen Read More …
[Solved]: Minimize Deterministic Finite Automata with no accepting states
Problem Detail: I have a finite automaton with no final/accepting states, so F is empty. How do I minimize it? I got this on a test and I didn’t know how to approach the problem because the automaton had no accepting Read More …
[Solved]: Hash table versus binary search lookup for unchanging data
Problem Detail: Let’s say I have some static, unchanging data (no adds, modifies or deletes) which is looked up by a string value, and that I’m looking to minimize size in memory while also trying to minimize lookup time. It seems Read More …
[Solved]: Software mutexes and consensus number 1
Problem Detail: There are numerous possibilities to implement a software mutex using only shared memory (e.g. Dekker’s algorithm). Recently I’ve read the following from a paper “Wait-free Synchronization” by M. Herlihy: there exists no two-process consensus protocol using multireader/multiwriter atomic registers. And Read More …
[Solved]: Does a regular expression model the empty language if it contains symbols not in the alphabet?
Problem Detail: Suppose $Sigma = { a,b }$ and the regular expression $(a^*b+dc)^*(b^*d + ad)^*$. Is it equal to $varnothing$? So I have a regular expression like this: $(a^*b+dc)^*$. As only $(a,b) in Sigma$, I see that: $dc=varnothing$ So $(a^*b+dc)^*=(a^*b)^*$. Then: Read More …
[Solved]: Removing arbitrary element from Max Heap
Problem Detail: Which of the following strategies is more feasible? Strategy 1: Remove the element from the array, compress the array and reheapify. Strategy 2: Update the value of this node to the current maximum value in the heap + 1, Read More …