Problem Detail: I’m trying to implement the Pastry Distributed Hash Table, but some things are escaping my understanding. I was hoping someone could clarify. Disclaimer: I’m not a computer science student. I’ve taken precisely two computer science courses in my life, Read More …
Blog
Data structure for storing edges of a graph
Problem Detail: I’m currently working on my masters thesis, and it’s about clustering on graphs. I’m working with an idea using ants to solve the problem. I’m currently working on the implementation and am wondering exactly how well to represent the Read More …
Look Ahead buffer vs Translation Look aside buffer
Problem Detail: I know that Translation look aside buffer is used for address translation in paging to achieve better performance. I came across term called Look Ahead buffer in a document which said it implements Temporal locality. I tried searching for Read More …
Solving $T(n)= 3T(frac{n}{4}) + ncdot lg(n)$ using the master theorem
Problem Detail: Introduction to Algorithms, 3rd edition (p.95) has an example of how to solve the recurrence $$displaystyle T(n)= 3Tleft(frac{n}{4}right) + ncdot log(n)$$ by applying the Master Theorem. I am very confused by how it is done. So, $a=3, b=4, f(n) Read More …
Complexity of finding the largest $m$ numbers in an array of size $n$
Problem Detail: What follows is my algorithm for doing this in what I believe to be $O(n)$ time, and my proof for that. My professor disagrees that it runs in $O(n)$ and instead thinks that it runs in $Omega(n^2)$ time. Any Read More …
How do I compute the luminance of a pixel?
Problem Detail: I have a color (say $R=100, G=150, B=130$). How do I compute its intensity? Do I just sum up all three components? Or are the colors not evenly weighted? Asked By : David Faux Answered By : Pål GD The colors Read More …
Which of the following regular expressions generate(s) no string with two consecutive 1’s?
Problem Detail: This is a GRE practice question. Which of the following regular expressions generate(s) no string with two consecutive 1’s? (Note that ε denotes the empty string.) I. (1 + ε)(01 + 0)* II. (01+10)* III. (0+1)*(0+ε) (A) I only Read More …
Most efficient algorithm to print 1-100 using a given random number generator
Problem Detail: We are given a random number generator RandNum50 which generates a random integer uniformly in the range 1–50. We may use only this random number generator to generate and print all integers from 1 to 100 in a random Read More …
Fastest mode of data transfer
Problem Detail: Which of the following modes of data transfer is the fastest? a. DMA b. Interrupt-based c. Polling d. All are equally fast I do not have the answer, so I cannot check, that’s why I am posting here. I Read More …
What is the time complexity of calling successor $n$ times during tree traversal?
Problem Detail: According to some sources, the time complexity of finding the successor of a node in a tree is $O(h)$. So, if the tree is well balanced, the height $h=log n$, and the successor function takes time $O(log n)$. Yet, Read More …