Most Popular
1500 questions
58
votes
12 answers
Does a byte contain 8 bits, or 9?
I read in this assembly programming tutorial that 8 bits are used for data while 1 bit is for parity, which is then used for detecting parity error (caused by hardware fault or electrical disturbance).
Is this true?

xtt
- 729
- 1
- 5
- 9
58
votes
4 answers
Time complexity of a compiler
I am interested in the time complexity of a compiler. Clearly this is a very complicated question as there are many compilers, compiler options and variables to consider. Specifically, I am interested in LLVM but would be interested in any thoughts…

superbriggs
- 705
- 5
- 6
58
votes
5 answers
Factorial algorithm more efficient than naive multiplication
I know how to code for factorials using both iterative and recursive (e.g. n * factorial(n-1) for e.g.). I read in a textbook (without been given any further explanations) that there is an even more efficient way of coding for factorials by dividing…

user65165
- 725
- 1
- 7
- 7
57
votes
6 answers
Why are so many internet protocols text-based?
From what I have found, a very large amount of protocols that travel over the internet are "text-based" rather than binary. The protocols in question include, but are not limited to HTTP, SMTP, FTP (I think this one is all text-based?), WHOIS,…

IQAndreas
- 741
- 1
- 5
- 9
57
votes
11 answers
Why would anyone want CISC?
In our computer systems lecture we were introduced to the MIPS processor. It was (re)developed over the course of the term and has in fact been quite easy to understand. It uses a RISC design, that is its elementary commands are regularly encoded…

Raphael
- 72,336
- 29
- 179
- 389
56
votes
8 answers
How are variables stored in and retrieved from the program stack?
Apologies in advance for the naivety of this question. I am a 50 year old artist trying to properly understand computers really for the first time. So here goes.
I have been trying to understand how data types and variables are handled by a compiler…

Celine Atwood
- 679
- 1
- 6
- 4
56
votes
5 answers
How is this sorting algorithm Θ(n³) and not Θ(n²), worst-case?
I just starting taking a course on Data Structures and Algorithms and my teaching assistant gave us the following pseudo-code for sorting an array of integers:
void F3() {
for (int i = 1; i < n; i++) {
if (A[i-1] > A[i]) {
…

Anthony Rossello
- 611
- 5
- 5
56
votes
4 answers
Why polynomial time is called "efficient"?
Why in computer science any complexity which is at most polynomial is considered efficient?
For any practical application(a), algorithms with complexity $n^{\log n}$ are way faster than algorithms that run in time, say, $n^{80}$, but the first is…

Ran G.
- 20,684
- 3
- 60
- 115
55
votes
5 answers
Why is the Mersenne Twister regarded as good?
The Mersenne Twister is widely regarded as good. Heck, the CPython source says that it "is one of the most extensively tested generators in existence." But what does this mean? When asked to list properties of this generator, most of what I can…

Veedrac
- 952
- 1
- 7
- 16
55
votes
2 answers
How to define quantum Turing machines?
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 can actually benefit from…

Ran G.
- 20,684
- 3
- 60
- 115
55
votes
3 answers
Why did Google not use an NP problem for their quantum supremacy experiment?
Reading discussions of the recent quantum supremacy experiment by Google I noticed that a lot of time and effort (in the experiment itself, but also in the excellent blog posts by Scott Aaronson and others explaining the results) is spent on…

Vincent
- 723
- 1
- 5
- 12
54
votes
6 answers
Why are some games np-complete?
I read the Wikipedia entry about "List of NP-complete problems" and found that games like super mario, pokemon, tetris or candy crush saga are np-complete. How can I imagine np-completeness of a game? Answers don't need to be too precise. I just…

racc44
- 657
- 2
- 7
- 11
54
votes
9 answers
How to prove a language is regular?
There are many methods to prove that a language is not regular, but what do I need to do to prove that some language is regular?
For instance, if I am given that $L$ is regular,
how can I prove that the following $L'$ is regular, too?
$\qquad…

corium
- 889
- 1
- 8
- 9
54
votes
1 answer
What is the earliest use of the "this" keyword in any programming language?
I understand the this (or self or Me) is used to refer to the current object, and that it is a feature of object-oriented programming languages. The earliest language I could find which has such a concept was Smalltalk, which uses self but was…

huijing
- 651
- 1
- 5
- 7
53
votes
4 answers
What is the meaning of $O(m+n)$?
This is a basic question, but I'm thinking that $O(m+n)$ is the same as $O(\max(m,n))$, since the larger term should dominate as we go to infinity? Also, that would be different from $O(\min(m,n))$. Is that right? I keep seeing this notation,…

Frank
- 1,612
- 1
- 13
- 15