Questions tagged [computer-science]
Computer science (CS) is the science behind programming. Use for questions related to the more theoretical questions involving programming. Questions of a purely theoretical nature may be off-topic. All CS questions can be asked on https://cs.stackexchange.com/
computer-science
4,492
questions
5373
votes
43
answers
831k
views
What is a plain English explanation of "Big O" notation?
I'd prefer as little formal definition as possible and simple mathematics.
1442
votes
12
answers
709k
views
What are the differences between NP, NP-Complete and NP-Hard?
What are the differences between NP, NP-Complete and NP-Hard?
I am aware of many resources all over the web. I'd like to read your explanations, and the reason is they might be different from what's ...
1222
votes
19
answers
651k
views
What is the difference between statically typed and dynamically typed languages?
What does it mean when we say a language is dynamically typed versus statically typed?
849
votes
24
answers
394k
views
What is a lambda (function)?
For a person without a comp-sci background, what is a lambda in the world of Computer Science?
793
votes
83
answers
387k
views
What are the lesser known but useful data structures?
There are some data structures around that are really useful but are unknown to most programmers. Which ones are they?
Everybody knows about linked lists, binary trees, and hashes, but what about ...
643
votes
29
answers
588k
views
What is polymorphism, what is it for, and how is it used?
What is polymorphism, what is it for, and how is it used?
561
votes
129
answers
59k
views
Significant new inventions in computing since 1980
This question arose from comments about different kinds of progress in computing over the last 50 years or so.
I was asked by some of the other participants to raise it as a question to the whole ...
543
votes
22
answers
192k
views
What is a 'Closure'?
I asked a question about Currying and closures were mentioned.
What is a closure? How does it relate to currying?
514
votes
23
answers
486k
views
What is “two's complement”?
I'm in a computer systems course and have been struggling, in part, with two's complement. I want to understand it, but everything I've read hasn't brought the picture together for me. I've read the ...
452
votes
21
answers
198k
views
Way to go from recursion to iteration
I've used recursion quite a lot during my many years of programming to solve simple problems, but I'm fully aware that sometimes you need iteration due to memory/speed problems.
So, sometime in the ...
440
votes
18
answers
143k
views
What is a Y-combinator? [closed]
A Y-combinator is a computer science concept from the “functional” side of things. Most programmers don't know much at all about combinators, if they've even heard about them.
What is a Y-...
353
votes
7
answers
218k
views
What is "entropy and information gain"?
I am reading this book (NLTK) and it is confusing. Entropy is defined as:
Entropy is the sum of the probability of each label
times the log probability of that same label
How can I apply ...
351
votes
8
answers
256k
views
What is code coverage and how do YOU measure it? [closed]
What is code coverage and how do YOU measure it?
I was asked this question regarding our automating testing code coverage. It seems to be that, outside of automated tools, it is more art than science....
348
votes
13
answers
151k
views
What is Type-safe?
What does "type-safe" mean?
342
votes
15
answers
70k
views
What is referential transparency?
What does the term referential transparency mean? I've heard it described as "it means you can replace equals with equals" but this seems like an inadequate explanation.
272
votes
6
answers
175k
views
What's "P=NP?", and why is it such a famous question? [closed]
The question of whether P=NP is perhaps the most famous in all of Computer Science. What does it mean? And why is it so interesting?
Oh, and for extra credit, please post a proof of the statement's ...
247
votes
9
answers
90k
views
Is there a difference between foreach and map?
Ok this is more of a computer science question, than a question based on a particular language, but is there a difference between a map operation and a foreach operation? Or are they simply different ...
235
votes
21
answers
202k
views
How to determine the longest increasing subsequence using dynamic programming?
I have a set of integers. I want to find the longest increasing subsequence of that set using dynamic programming.
220
votes
7
answers
199k
views
What exactly does big Ө notation represent?
I'm really confused about the differences between big O, big Omega, and big Theta notation.
I understand that big O is the upper bound and big Omega is the lower bound, but what exactly does big Ө (...
216
votes
13
answers
152k
views
Are duplicate keys allowed in the definition of binary search trees?
I'm trying to find the definition of a binary search tree and I keep finding different definitions everywhere.
Some say that for any given subtree the left child key is less than or equal to the ...
179
votes
9
answers
27k
views
Does "untyped" also mean "dynamically typed" in the academic CS world?
I'm reading a slide deck that states "JavaScript is untyped." This contradicted what I thought to be true so I started digging to try and learn more.
Every answer to Is JavaScript an untyped language?...
172
votes
8
answers
43k
views
Eventual consistency in plain English
I often hear about eventual consistency in different speeches about NoSQL, data grids etc.
It seems that definition of eventual consistency varies in many sources (and maybe even depends on a ...
166
votes
8
answers
111k
views
B-Tree vs Hash Table
In MySQL, an index type is a b-tree, and access an element in a b-tree is in logarithmic amortized time O(log(n)).
On the other hand, accessing an element in a hash table is in O(1).
Why is a hash ...
164
votes
7
answers
191k
views
Fixed point vs Floating point number
I just can't understand fixed point and floating point numbers due to hard to read definitions about them all over Google. But none that I have read provide a simple enough explanation of what they ...
155
votes
5
answers
90k
views
What is an SSTable?
In BigTable/GFS and Cassandra terminology, what is the definition of a SSTable?
153
votes
7
answers
90k
views
What does 'predicate' mean in the context of computer science? [duplicate]
Specifically I've seen it used in the context of text filtering. As if "predicate" == "filter criteria".
Is this accurate?
151
votes
7
answers
98k
views
When to use Preorder, Postorder, and Inorder Binary Search Tree Traversal strategies
I realized recently that while having used BST's plenty in my life, I've never even contemplated using anything but Inorder traversal (while I am aware of and know how easy it is to adapt a program to ...
142
votes
13
answers
69k
views
Hash Code and Checksum - what's the difference?
My understanding is that a hash code and checksum are similar things - a numeric value, computed for a block of data, that is relatively unique.
i.e. The probability of two blocks of data yielding ...
121
votes
40
answers
227k
views
What is recursion and when should I use it?
One of the topics that seems to come up regularly on mailing lists and online discussions is the merits (or lack thereof) of doing a Computer Science Degree. An argument that seems to come up time and ...
120
votes
3
answers
176k
views
What do we mean by Byte array? [closed]
Could someone please explain, I do not exactly get the concept.
What is a Byte Array?
Where and when we use it in applications/programs?
what are the advantages and disadvantages of using a byte ...
97
votes
33
answers
73k
views
What Computer Science concepts should I know? [closed]
What concepts in Computer Science do you think have made you a better programmer?
My degree was in Mechanical Engineering so having ended up as a programmer, I'm a bit lacking in the basics. There ...
95
votes
7
answers
19k
views
What is a Lambda?
Could someone provide a good description of what a Lambda is? We have a tag for them and they're on the secrets of C# question, but I have yet to find a good definition and explanation of what they ...
90
votes
15
answers
69k
views
Why binary and not ternary computing? [closed]
Isn't a three state object immedately capable of holding more information and handling larger values? I know that processors currently use massive nets of XOR gates and that would need to be reworked....
90
votes
5
answers
34k
views
Calculate minimal operations to make two tree structures identical
This is more of a CS question, but an interesting one :
Let's say we have 2 tree structures with more or less the same nodes reorganized. How would you find
any
in some sense minimal
sequence of ...
89
votes
12
answers
39k
views
Function pointers, Closures, and Lambda
I am just now learning about function pointers and, as I was reading the K&R chapter on the subject, the first thing that hit me was, "Hey, this is kinda like a closure." I knew this ...
78
votes
11
answers
25k
views
How helpful is knowing lambda calculus? [closed]
To all the people who know lambda calculus: What benefit has it bought you, regarding programming? Would you recommend that people learn it?
70
votes
15
answers
65k
views
What is the computer science definition of entropy?
I've recently started a course on data compression at my university. However, I find the use of the term "entropy" as it applies to computer science rather ambiguous. As far as I can tell, it roughly ...
69
votes
3
answers
83k
views
Math for computer science [closed]
I have read several answers on this topic , but I still have questions..
There are plenty of math courses, and I don't know which one to take first.
Which math classes should every computer scientist ...
69
votes
7
answers
33k
views
Turing machine vs Von Neuman machine
Background
The Von-Neumann architecture describes the stored-program computer where instructions and data are stored in memory and the machine works by changing its internal state, i.e an instruction ...
67
votes
7
answers
19k
views
Explain the proof by Vinay Deolalikar that P != NP [closed]
Recently there has been a paper floating around by Vinay Deolalikar at HP Labs which claims to have proved that P != NP.
Could someone explain how this proof works for us less mathematically ...
63
votes
4
answers
290k
views
HTML5 Canvas background image
I'm trying to place a background image on the back of this canvas script I found. I know it's something to do with the context.fillstyle but not sure how to go about it. I'd like that line to read ...
63
votes
11
answers
89k
views
What are vectors and how are they used in programming?
I'm familiar with the mathematical/physics concept of a vector as a magnitude and a direction, but I also keep coming across references to vectors in the context of programming (for example C++ seems ...
61
votes
3
answers
10k
views
What is the 'expression problem'?
I have a rough idea about what this is but if someone has an explanation of the 'expression problem' that they think is succinct and intuitive I would love to hear it.
60
votes
4
answers
39k
views
What is a finite state transducer?
Can someone please tell me what a finite state transducer is?
I have read the Wikipedia article and don't understand a thing.
59
votes
24
answers
26k
views
What exactly is the halting problem?
Whenever people ask about the halting problem as it pertains to programming, people respond with "If you just add one loop, you've got the halting program and therefore you can't automate task"
Makes ...
58
votes
2
answers
76k
views
Difference between compiled and interpreted languages?
What are the relative strengths and weaknesses of compiled and interpreted languages?
56
votes
24
answers
22k
views
O(log N) == O(1) - Why not?
Whenever I consider algorithms/data structures I tend to replace the log(N) parts by constants. Oh, I know log(N) diverges - but does it matter in real world applications?
log(infinity) < 100 ...
56
votes
3
answers
17k
views
Why are both little- and big-endian in use?
Why are both little- and big-endian still in use today, after ~40 years of binary computer-science? Are there algorithms or storage formats that work better with one and much worse with the other? ...
52
votes
13
answers
14k
views
What are practical guidelines for evaluating a language's "Turing Completeness"?
I've read "what-is-turing-complete" and the wikipedia page, but I'm less interested in a formal proof than in the practical implications of requirements for being Turing Complete.
What I'm ...
52
votes
7
answers
52k
views
Is there ever a good reason to use Insertion Sort?
For general-purpose sorting, the answer appears to be no, as quick sort, merge sort and heap sort tend to perform better in the average- and worst-case scenarios. However, insertion sort appears to ...