Answered By : Yuval Filmus Hint: The search x AND y will result in 10 000 hits. Problem Detail: My mother is taking some online course in order to be a librarian of sorts, in this course they cover boolean searches, so Read More …
Category: Uncategorized
(AVL Trees) What is the maximum possible difference between the number of nodes in the root node’s subtrees?
Answered By : Mowji I assume that we start labeling heights from $0$. Actually your approach is right. You must consider the left-side (or right-side) sub-tree with the least possible amount of nodes and the right-side (or left-side) sub-tree with the Read More …
Finding paths with smallest maximum edge weight
Answered By : Joe You’re right; it’s essentially a MST problem. First build the minimum spanning tree, then use breadth-first or depth-first search to find the unique path in the tree between the two vertices. Problem Detail: I need to find the Read More …
Do you get DFS if you change the queue to a stack in a BFS implementation?
Answered By : Aryabhata No, this is not the same as a DFS. Consider the graph If you push the nodes in right to left order, the algorithm gives you a traversal: $A, B , E, C , D$ while a Read More …
Can we say DFA is more efficient than NFA?
Answered By : Khaur There are two answers, depending on how you define efficient. Compactness of representation Telling more with less: NFAs are more efficient. Converting a DFA to an NFA is straightforward and does not increase the size of the Read More …
Can a runtime environment detect an infinite loop?
Answered By : Kyle Strand It might be theoretically possible for a runtime environment to check for such loops using the following procedure: After ever instruction executed, the runtime environment would make a complete image of the state of a running Read More …
Generating Combinations from a set of pairs without repetition of elements
Answered By : Carl Mummert One direct way is a recursive procedure that does the following on each invocation. The input to the procedure is a list of pairs that have already been chosen and a list of all the pairs. Read More …
Reason to learn propositional & predicate logic
Answered By : Guy Coder I tend to like Unification and anything related to it. If you don’t know propositional & predicate logic, then you are skipping the basics of logic. If you have an interest in anything listed, then it Read More …
difference between lzw and huffman coding technique
Answered By : Yuval Filmus Lempel–Ziv encoding (or rather, encodings, since there are many different variants) and Huffman coding are very different algorithms. Huffman coding. Choose a block length, usually one byte. For each possible value of the block, we choose Read More …
Is zero allowed as an edge’s weight, in a weighted graph?
Answered By : David Richerby Allowed by whom? There is no Central Graph Administration that decides what you can and cannot do. You can define objects in any way that’s convenient for you, as long as you’re clear about what the Read More …