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 (also called computing science, and often abbreviated CS) is the study of the theoretical foundations of information and computation and of practical techniques for their implementation and application in computer systems. Computer scientists invent algorithmic processes that create, describe, and transform information and formulate suitable abstractions to model complex systems.

As a discipline, computer science spans a range of topics from theoretical studies of algorithms and the limits of computation to the practical issues of implementing computing systems in hardware and software.

While some computer science questions are on-topic for Stack Overflow, many of the more theoretical questions or questions that do not apply to programming are off-topic. You can ask these types of questions on the Computer Science Stack Exchange.

4449 questions
270
votes
6 answers

What's "P=NP?", and why is it such a famous question?

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 truth or falsehood. :)
raldi
  • 21,344
  • 33
  • 76
  • 86
244
votes
9 answers

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 names for the same thing?
Robert Gould
  • 68,773
  • 61
  • 187
  • 272
235
votes
21 answers

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
  • 2,503
  • 4
  • 16
  • 7
215
votes
7 answers

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 Ө (theta) represent? I have read that it means tight…
user1364768
  • 2,213
  • 3
  • 16
  • 8
209
votes
13 answers

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 root. Some say that for any given subtree the right…
Tim Merrifield
  • 6,088
  • 5
  • 31
  • 33
178
votes
9 answers

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? says that JavaScript is not untyped and offered…
Peter Cooper
  • 2,907
  • 28
  • 67
  • 87
171
votes
8 answers

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 concrete data storage). Can anyone give a simple…
Roman
  • 64,384
  • 92
  • 238
  • 332
160
votes
8 answers

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 table not used instead of a b-tree in order to…
JohnJohnGa
  • 15,446
  • 19
  • 62
  • 87
156
votes
7 answers

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 really are. Can I get a plain definition with…
user942451
  • 1,595
  • 2
  • 12
  • 6
151
votes
7 answers

What does 'predicate' mean in the context of computer science?

Specifically I've seen it used in the context of text filtering. As if "predicate" == "filter criteria". Is this accurate?
ack
  • 14,285
  • 22
  • 55
  • 73
149
votes
5 answers

What is an SSTable?

In BigTable/GFS and Cassandra terminology, what is the definition of a SSTable?
knorv
  • 49,059
  • 74
  • 210
  • 294
144
votes
7 answers

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 use pre/post-order traversal). Upon realizing…
John Humphreys
  • 37,047
  • 37
  • 155
  • 255
140
votes
13 answers

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 the same numeric hash/checksum value is low enough…
Richard Ev
  • 52,939
  • 59
  • 191
  • 278
121
votes
40 answers

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 again for the negative party is that they have…
Mike Minutillo
  • 54,079
  • 14
  • 47
  • 41
119
votes
3 answers

What do we mean by Byte array?

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 array?
daydreamer
  • 87,243
  • 191
  • 450
  • 722