Question Detail: I am having confusion whether storage media and storage devices are the same terms. I found on this yahoo answers page that there is a subtle difference but very tricky to understand. I have googled a lot but cannot Read More …
Blog
Why is quicksort better than other sorting algorithms in practice?
Question Detail: In a standard algorithms course we are taught that quicksort is $O(n log n)$ on average and $O(n^2)$ in the worst case. At the same time, other sorting algorithms are studied which are $O(n log n)$ in the worst Read More …
What is a the fastest sorting algorithm for an array of integers?
Question Detail: I have come across many sorting algorithms during my high school studies. However, I never know which is the fastest (for a random array of integers). So my questions are: Which is the fastest currently known sorting algorithm? Theoretically, Read More …
How to convert finite automata to regular expressions?
Question Detail: Converting regular expressions into (minimal) NFA that accept the same language is easy with standard algorithms, e.g. Thompson’s algorithm. The other direction seems to be more tedious, though, and sometimes the resulting expressions are messy. What algorithms are there Read More …
How to calculate the number of tag, index and offset bits of different caches?
Question Detail: Specifically: 1) A direct-mapped cache with 4096 blocks/lines in which each block has 8 32-bit words. How many bits are needed for the tag and index fields, assuming a 32-bit address? 2) Same question as 1) but for fully Read More …
What is the definition of P, NP, NP-complete and NP-hard?
Question Detail: I’m in a course about computing and complexity, and am unable to understand what these terms mean. All I know is that NP is a subset of NP-complete, which is a subset of NP-hard, but I have no idea Read More …
How to prove that a language is not regular?
Question Detail: We learned about the class of regular languages $mathrm{REG}$. It is characterised by any one concept among regular expressions, finite automata and left-linear grammars, so it is easy to show that a given language is regular. How do I Read More …
What exactly is the difference between supervised and unsupervised learning?
Question Detail: Right now I am trying to understand Clustering-methods. What I understood by now: In supervised learning the categories, data is assigned to are known before computation. So they are being used in order to ‘learn’ the parameters that are Read More …
What’s the difference between a binary search tree and a binary heap?
Question Detail: These two seem very similar and have almost an identical structure. What’s the difference? What are the runtime complexities of each? Asked By : piperchester Best Answer from StackOverflow Question Source : http://cs.stackexchange.com/questions/27860 Answered By : Ali786 Heap just guarantees that elements Read More …
How can a language whose compiler is written in C ever be faster than C?
Question Detail: Taking a look at Julia’s webpage, you can see some benchmarks of several languages across several algorithms (timings shown below). How can a language with a compiler originally written in C, outperform C code? Figure: benchmark times relative to Read More …