Problem Detail: This is a problem from a past contest at topcoder : Problem. Its solution is given here : Solution [Scroll Down to Penguin Emperor] I am unable to understand how the section with subheading “Combinations are associative” works. What Read More …
Author: ignougroup
How to find the minimum number of vertices whose removal make the graph disjoint
Problem Detail: Given a graph $G = (V,E)$. Is there any algorithm which finds the minimum number of vertices to be removed from $G$ so that every vertex in the graph becomes disjoint, i.e., every vertex is disconnected from every other Read More …
Average depth of a Binary Search Tree and AVL Tree
Problem Detail: My professor recently mentioned that the average depth of the nodes in a binary search tree will be $O(log(n))$ where $n$ is the amount of nodes in the tree. I ended up drawing out a bunch of binary search Read More …
Difference between end carry and overflow
Problem Detail: I am confused with end carry and overflow. When will an end carry be the overflow? How to identify whether the end carry is overflow or not? Are they both same? Sometimes end carries obtained are simply discarded and Read More …
Connection between KMP prefix function and string matching automaton
Problem Detail: Let $A_P = (Q,Sigma,delta,0,{m})$ the string matching automaton for pattern $P in Sigma^m$, that is $Q = {0,1,dots,m}$ $delta(q,a) = sigma_P(P_{0,q}cdot a)$ for all $qin Q$ and $ain Sigma$ with $sigma_P(w)$ the length of the longest prefix of $P$ Read More …
Construct Turing Machine which accepts the language $ww$
Problem Detail: I try to construct a TM that accepts the language ${ ww mid w in {a,b}^* }$. Between the words $w$ is no delimeter, so I don’t know, how my TM can know where the first $w$ ends and Read More …
Why do we use persistent data structures in functional programming?
Problem Detail: Functional programming employs persistent data structures and immutable objects. My question is why is it crucial to have such data structures here? I want to understand at a low level what would happen if the data structure is not Read More …
Sorting algorithms which accept a random comparator
Problem Detail: Generic sorting algorithms generally take a set of data to sort and a comparator function which can compare two individual elements. If the comparator is an order relation¹, then the output of the algorithm is a sorted list/array. I Read More …
Do self-loops in DFA cause infinite languages?
Problem Detail: A true/false question: If a DFA $M$ contains a self-loop on some state $q$, then $M$ must accept an infinite language. The answer is “false”. I’ve read this question, but I’m still wondering why $M$ does not necessarily accept Read More …
A multi-user, multi-processing operating system cannot be implemented on hardware that does not support
Problem Detail: A multi-user, multi-processing operating system cannot be implemented on hardware that does not support Address translation DMA for disk transfer At least two modes of CPU execution (privileged and non-privileged) Demand paging My attempt: Somewhere it explain as : Read More …