Problem Detail: I’m reading through “Computers and Intractability: A guide to the Theory of NP-Completeness” by Michael R. Garey and David S. Johnson, p. 20 and I came across this concept of a function that is polynomially related to input lengths Read More …
Blog
[Solved]: Modified Djikstra’s algorithm
Problem Detail: So, I’m trying to conceptualize something: Say we have a weighed graph of size N. A and B are nodes on the graph. You want to find the shortest path from A to B, given a few caveats: movements Read More …
[Solved]: How again do certain sorting methods use $o(n log n)$ time?
Problem Detail: I hope this question isn’t too ‘soft’ for here. It’s been a while $tiny{text{an eternity for some people’s standards}}$ since I’ve touched this stuff, and I had a convincing explanation to this question eight minutes ago but must have Read More …
[Solved]: Schedule tasks from a weighted list with time frame constraints
Problem Detail: I’m attempting to create an automatic scheduler from a list of tasks I have available. Here are the key points: Each task has been given a priority beforehand and the algorithm should try to maximize the total ‘priority points’ Read More …
[Solved]: Huffman code optimal substructure property
Problem Detail: I am learning about Greedy Algorithms and we did an example on Huffman codes. To prove the correctness of our algorithm, we had to have the greedy choice property and the optimal substructure property. Here is what my professor Read More …
[Solved]: Can not follow the example for max-flow-min-cut on Wikipedia
Problem Detail: This Wikipedia example is very confusing. Its saying the max flow = min cut. But I see the max flow = 9 and the min cut = 7. If not, how does the capacity =min cut here? Which is Read More …
[Solved]: Should activation function be monotonic in neural networks?
Problem Detail: A lot of activation functions in neural networks (sigmoid, tanh, softmax) are monotonic, continuous and differentiable (except of may be a couple of points, where derivative does not exist). I understand the reason for continuity and differentiability, but can Read More …
[Solved]: Why is quiescent consistency compositional, but sequential consistency is not
Problem Detail: I’m having trouble in comparing these two memory consistency models. Essentially for sequential consistency I think of real code like this: int x, y; void ThreadA() { x = 20; //Write int a = y; //Read } void ThreadB() Read More …
[Solved]: Direct Cache Mapping – Addressing
Problem Detail: I’ve looked through all the other similar questions, but I don’t feel like I understood exactly what I’m supposed to do with my case, so I’m hoping I’m not the only one. In an exercise I’m doing, I’m told Read More …
[Solved]: Every AVL tree may be red black tree
Problem Detail: I proved by induction that every AVL tree may be colored such that it will be red black tree. The problem is that I can’t see an error in my proof. Look at my proof. Induction for height. Let’s Read More …