Question Detail: I tried this problem from CLRS (Page 39, 2.3-4) We can express insertion sort as a recursive procedure as follows. In order to sort A[1… n], we recursively sort A[1… n-1] and then insert A[n] into the sorted array Read More …
Blog
Knapsack problem — NP-complete despite dynamic programming solution?
Question Detail: Knapsack problems are easily solved by dynamic programming. Dynamic programming runs in polynomial time; that is why we do it, right? I have read it is actually an NP-complete problem, though, which would mean that solving the problem in Read More …
What is meant by interrupts in the context of operating systems?
Question Detail: I’ve decided to read Operating Systems Concepts by Silberschatz, Galvin Gagne (8th edition) over the summer. I’ve gotten to a topic that’s confusing me – interrupts and their role as it relates to operating systems. The text says that Read More …
What is an asymptotically tight upper bound?
Question Detail: From what I have learned asymptotically tight bound means that it is bound from above and below as in theta notation. But what does asymptotically tight upper bound mean for Big-O notation? Asked By : nangal.vivek Best Answer from StackOverflow Read More …
Proving that the average case complexity of binary search is O(log n)
Question Detail: I know that the both the average and worst case complexity of binary search is O(log n) and I know how to prove the worst case complexity is O(log n) using recurrence relations. But how would I go about Read More …
Cognitive Computing vs Artificial Intelligence?
Question Detail: Can anyone please tell me the difference between them? A brief definition of Cognitive Computing would appreciated. Also how does cognitive computing relate to neural networks? Asked By : OFR Best Answer from StackOverflow Question Source : http://cs.stackexchange.com/questions/37118 Answered By : OFR Read More …
How to solve T(n) = T(n-1) + n^2?
Question Detail: See title. I’m trying to apply the method from this question. What I have so far is this, but I don’t know how to proceed from here on: T(n) = T(n-1) + n2 T(n-1) = T(n-2) + (n-1)2 = Read More …
Quicksort explained to kids
Question Detail: Last year, I was reading a fantastic paper on “Quantum Mechanics for Kindergarden”. It was not easy paper. Now, I wonder how to explain quicksort in the simplest words possible. How can I prove (or at least handwave) that Read More …
Computing the longest common substring of two strings using suffix arrays
Question Detail: After I learned how to build a suffix array in $O(N)$ complexity, I am interested in discovering the applications of the suffix arrays. One of these is finding the longest common substring between two strings, in $O(N)$ time. I Read More …
Understanding LEADING and TRAILING operations of an operator precedence grammar
Question Detail: I want to understand what the LEADING and TRAILING of non-terminal in an operator precedence grammar physically mean. I am confused by the various definitions I have read on them. I understand that the LEADING of a non-terminal is Read More …