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
Filter by
Sorted by
Tagged with
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.
Arec Barrwin's user avatar
  • 61.8k
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 ...
DarthVader's user avatar
  • 54.1k
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?
Rachel's user avatar
  • 102k
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?
Brian Warshaw's user avatar
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?
UnkwnTech's user avatar
  • 89.3k
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 ...
Gustavo Carreno's user avatar
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-...
Chris Ammerman's user avatar
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 ...
TIMEX's user avatar
  • 265k
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....
Brian G's user avatar
  • 54.3k
348 votes
13 answers
151k views

What is Type-safe?

What does "type-safe" mean?
user avatar
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.
Claudiu's user avatar
  • 227k
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 ...
raldi's user avatar
  • 21.6k
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 ...
Robert Gould's user avatar
  • 69.2k
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.
Tony's user avatar
  • 2,503
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 Ө (...
user1364768's user avatar
  • 2,263
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 ...
Tim Merrifield's user avatar
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?...
Peter Cooper's user avatar
  • 2,917
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 ...
Roman's user avatar
  • 65.2k
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 ...
JohnJohnGa's user avatar
  • 15.6k
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 ...
user942451's user avatar
  • 1,675
155 votes
5 answers
90k views

What is an SSTable?

In BigTable/GFS and Cassandra terminology, what is the definition of a SSTable?
knorv's user avatar
  • 49.6k
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?
ack's user avatar
  • 14.5k
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 ...
John Humphreys's user avatar
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 ...
Richard Ev's user avatar
  • 53.6k
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 ...
daydreamer's user avatar
  • 89.2k
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 ...
Fred's user avatar
  • 2,713
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....
ojblass's user avatar
  • 21.4k
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 ...
Tomas Vana's user avatar
  • 18.5k
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 ...
None's user avatar
  • 2,937
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?
TraumaPony's user avatar
  • 10.8k
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 ...
fluffels's user avatar
  • 4,071
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 ...
LoLzMan's user avatar
  • 703
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 ...
Santhosh's user avatar
  • 6,627
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 ...
Sam Skirrow's user avatar
  • 3,657
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 ...
Redwood's user avatar
  • 67.9k
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.
James's user avatar
  • 2,326
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.
user581734's user avatar
  • 1,229
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 ...
poundifdef's user avatar
  • 19.2k
58 votes
2 answers
76k views

Difference between compiled and interpreted languages?

What are the relative strengths and weaknesses of compiled and interpreted languages?
amine's user avatar
  • 721
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 ...
phoku's user avatar
  • 2,082
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? ...
orlp's user avatar
  • 114k
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 ...
AShelly's user avatar
  • 35k
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 ...
user avatar

1
2 3 4 5
90