Problem Detail: A* search finds optimal solution to problems as long as the heuristic is admissible which means it never overestimates the cost of the path to the from any given node (and consistent but let us focus on being admissible Read More …
Blog
Potential function binary heap extract max O(1)
Problem Detail: I need help figuring the potential function for a max heap so that extract max is completed in $O(1)$ amortised time. I should add that I do not have a good understanding of the potential method. I know that Read More …
Variant of the knapsack problem
Problem Detail: How would you approach the knapsack problem in a dynamic programming situation if you now have to limit the number of item in the knapsack by a constant $p$ ? This is the same problem (max weight of $W$, Read More …
Prove transitivity of big-O notation
Problem Detail: I’m doing a practice question (not graded HW) to understand mathematical proofs and their application to Big O proofs. So far, however, the very first problem in my text is stumping me wholly. Suppose $f(n) = O(g(N))$ and $g(n) Read More …
Is every NP-hard problem computable?
Problem Detail: Is it required that a NP-hard problem must be computable? I don’t think so, but I am not sure. Asked By : Kevin Meier Answered By : jmite No, an $NP$-hard problem need not be computable. The definition is fairly complete: Read More …
Artificial Intelligence: Condition for BFS being optimal
Problem Detail: It is said in the book Artificial Intelligence: A Modern Approach for finding a solution on a tree using BFS that: breadth-first search is optimal if the path cost is a nondecreasing function of the depth of the node. Read More …
algorithm time analysis “input size” vs “input elements”
Problem Detail: I’m still a bit confused with the terms “input length” and “input size” when used to analyze and describe the asymptomatic upper bound for an algorithm Seems that input length for the algorithm depends a lot of the kind Read More …
Algorithm to add sum of every possible xor-sum sub-array
Problem Detail: I participated in one algorithmic competition. I got stuck in one problem, I am asking the same here. Problem Statement XOR-sum of a sub-array is to XOR all the numbers of that sub-array. An array is given to you, Read More …
How to define quantum Turing machines?
Problem Detail: In quantum computation, what is the equivalent model of a Turing machine? It is quite clear to me how quantum circuits can be constructed out of quantum gates, but how can we define a quantum Turing machine (QTM) that Read More …
Program compilation and execution flow
Problem Detail: I was studying operating system concepts from Silberschatz, Galvin and Gagne’s book (sixth edition) and I have some questions about the flow of execution of a program. A figure explains the processing of the user program: We get an Read More …