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 …
Category: Uncategorized
[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]: 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]: 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]: 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]: 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]: 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]: 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]: How to compute linear recurrence using matrix with fraction coefficients?
Problem Detail: What I’m trying to do is generate Motzkin numbers mod a large number $10^{14} + 7$ (not prime), and it needs to compute the $n$th Motzkin number as fast as possible. From Wikipedia, the formula for the $n$th Motzkin Read More …
[Solved]: Languages accepted by modified versions of finite automata
Problem Detail: A deterministic finite automaton (DFA) is a state machine model capable of accepting all and only regular languages. DFAs can be (and usually are) defined in such a way that each state must provide some transition for all elements Read More …