Computer science or computing science (abbreviated CS or CompSci) is the scientific approach to computation and its applications.

learn more… | top users | synonyms

2
votes
5answers
10k views
+50

How many bits' address is required for a computer with n bytes of memory?

How many bits of address is required (for the program counter for example) in a byte-addressed computer with 512 Mbyte RAM? What does the formula look like? How is this connected with the fact that ...
29
votes
8answers
20k views

What methods are there to avoid a stack overflow in a recursive algorithm?

Question What are the possible ways to solve a stack overflow caused by an recursive algorithm? Example I'm trying to solve Project Euler problem 14 and decided to try it with a recursive ...
-3
votes
1answer
57 views

Floating point error questions

Books teach us that single precision has 24 significands digits this is aproximatly 7 decimal significant digits. Now what would be the sense of printing a float with more than 7 digits? Im wondering ...
3
votes
1answer
469 views

Teaching Programming: drawbacks of using unit tests in problem statement for assignments? [closed]

I am experimenting with marking assignments for a programming course using unit tests. Is it likely to harm the learning process if I publish some of the tests I use as part of the problem statement? ...
26
votes
13answers
2k views

Help in understanding computer science, programming and abstraction [duplicate]

Until now, I always believed that you should learn programming languages that make you do low-level stuff (e.g. C) to understand what's really happening under the hood and how the computer really ...
10
votes
13answers
2k views

As a code monkey, how to discuss programming with a guy who almost has a doctorate in computer science [closed]

A friend of my wife's is coming over for dinner tonight and he is a lot smarter than me. What do we have in common, well... A Bachelor's in Computer Science, and that should be enough of a ...
0
votes
2answers
185 views

Why are semantics and type systems are so important?

I heard that semantics and type systems are very important for all programmers! But I why are they so important? I don't understand. Maybe they are imortant only for theoreticians and compiler ...
0
votes
0answers
35 views

avoid nan and inf in floating point multiplication and division

I have the following hypothesis: It is better to reorder mult and div operation in such a way that we can do our best effort to avoid nan, inf and operating with subnormals. The reorder should follow ...
28
votes
11answers
18k views

What to do when coding begins to feel boring, like it is all just more of the same? [closed]

I started programming at the age of 6 on a Commodore 64. Now I'm 28, and I have to complete 4 courses from a first degree in Computer Science. I'm starting to get bored with writing code after all ...
0
votes
1answer
46 views

Foundations of computation, and relation to modern computers [closed]

I want to understand how the theoretical foundations of computation relate to real-world computers. As far as my knowledge goes, Turing machines, recursive functions, finite state machines, lambda ...
3
votes
2answers
750 views

What does 'upper bound' mean in context of BigO?

My computer science teacher says Big O has an upper bound but no lower bound. When I look at a graph of an algorithm mapped out using BigO though, there isn't an upper bound at all. The upper limit ...
2
votes
2answers
74 views

From a set of rules, derive the implications? [closed]

I've only just become interested in this domain, so sorry if I'm not using the correct terminologies. What I want is the following: Say I have a set of rules (or constraints), I want to derive some ...
1
vote
2answers
77 views

How do Symbol Tables, Lexers and Parsers work together in a modern design? [closed]

I'm working on creating my own scripting language for learning purposes. I've been reading through the Dragon Book and some things are a little unclear to me regarding the Symbol Table as well as ...
0
votes
0answers
101 views

What is this compression algorithm? (Similar to RLE)

In Run Length Encoding (RLE), a large set of information is encoded by storing the quantity of consecutive sequences. A canonical example is: ...
32
votes
16answers
7k views

Will a computer science college degree ever hurt my employability? [closed]

Too often, I can see that there are many viable programmers without college degrees in Computer Science, Informatics, etc. Now that I've been reading more articles about underperforming education ...
13
votes
3answers
5k views

How is the actor model used?

I have read a bit about the actor model, but don't really understand how to use actors in a real world situation – how to model a problem with them. Can someone please explain? A simple example or ...
5
votes
7answers
3k views

How can variables be created at runtime? [closed]

Is it possible to define variables dynamically? Last night I was writing some code (C and VB2010) and I ran into a problem related to defining variables in my program. The variables needed depend on ...
23
votes
17answers
8k views

What are some good assignments for an introductory course, to reach today's students? [closed]

I periodically teach an introduction to programming course using Java. I want to give my students some exciting assignments that they can relate to or find interesting. At the very least, I want ...
66
votes
32answers
15k views

What's a nice explanation for pointers? [closed]

In your own studies (on your own, or for a class) did you have an "ah ha" moment when you finally, really understood pointers? Do you have an explanation you use for beginner programmers that seems ...
31
votes
2answers
1k views

What is the meaning of “doesn't compose”?

I see a lot of texts, especially functional programming texts, claim that certain CS concepts "don't compose". Examples are: locks don't compose, monads don't compose. I've been having a hard time ...
22
votes
6answers
1k views

How not to forget new and interesting information [closed]

The thing is that I read a lot of things over a period of time because it is interesting and I like to know it and secondly it will be helpful in my future job interviews. For example I read about ...
3
votes
4answers
423 views

How is a state machine different from any other computer program?

I have seen several implementations of "State Machines" on github. As far as I understand, a state machine takes input that may or may not transform its state into one of a finite set of other states. ...
12
votes
5answers
1k views

How come the computer doesn't have to read the entire table when the column is indexed? [duplicate]

Let's say a table with two columns has 100 quadrillion records. And I want to find a record that has column #2 equal something. If column #2 is indexed it returns the result immediately, but if it's ...
22
votes
12answers
54k views

What's the difference between computer science and programming?

I'm new at computer science and programming, and I was wondering, is there a difference between computer science and programming? and do you get to choose to study only one of them at the university, ...
0
votes
0answers
44 views

Fast comparison of recursive directory tree against a database?

I'm creating basic media player in the style of foobar2000. I want to load Id3 tags into a database because scanning whole directory tree every time is slow. The problem is, when user changes ...
16
votes
3answers
1k views

Should Software Engineering and Computer Science be separate majors? [closed]

For decades, the accepted degree to get to become a software developer was "Compter Science." We've had a few questions already about whether that degree really prepares students to develop software. ...
6
votes
2answers
229 views

Does any well-known license require to make modifications available when only derived *output* is published?

Is there a way to make sure that modifications to free software are released even when no binaries of modified code are conveyed? Though it may sound odd and from what I understand, e.g., GPL requires ...
0
votes
2answers
441 views

Is studying algorithms important for game development? [closed]

I am fairly new in the programming world, I have a 1-year experience and I learned by watching online courses, and I made few iOS apps. Now I am moving into game development and I already ...
2
votes
1answer
97 views

Find all factors(prime and composite) of a number

We can find all the prime factors using a Sieve of Erastothenes. But how do we find ALL the factors of a number? For instance, 24 = 2x2x2x3 But the complete factor list is - 1,2,3,4,6,8,12,24. I am ...
1
vote
2answers
449 views

Finding common prefixes for a set of strings

I am trying to find common prefixes for a sorted set of strings. i.e. if the following strings are given: AB123456 AB123457 ABCDEFGH ABCDEFGX1 ABCDEFGY XXXX then my function should return three ...
3
votes
2answers
522 views

Looking for a DP algorithm for a specific packing problem

I have the following problem to solve: Given a ferry with length d and a list of n cars conataining their length we must load the cars on the ferry in an order in which they appear in the list on 2 ...
10
votes
4answers
1k views

Good Programming Competitions for Highschool Students [closed]

What are good programming competitions (or web design competitions) available for highschool students in the Northeast (I am looking for a pretty long/comprehensive list)- of the USA? The competitions ...
15
votes
8answers
1k views

Is there a subset of programs that avoid the halting problem

I was just reading another explanation of the halting problem, and it got me thinking all the problems I've seen that are given as examples involve infinite sequences. But I never use infinite ...
6
votes
3answers
2k views

Quantum computers and Turing Machine

As far as I know, a Turing Machine is the widely used model in computational theory to know whether something could be computed and if computed can they can be computed in finite time (P, NP, ...
-2
votes
2answers
127 views

Practical applications of pattern printing programs [closed]

We all encounter programs like printing a pattern (Such as Pascal's Triangle). As a student of Computer Science, I am curious as to what is the practical application of these type of programs, in ...
2
votes
4answers
426 views

Should all programmers know how to solve algorithms, etc [closed]

I'm 15 and have been programming for about 3-4 years. I mostly program in Java as it was my first language. I would like to be a programmer when I'm older, but I'm not sure about the differences. ...
7
votes
2answers
1k views

What is the relationship between lambda calculus and programming languages? [closed]

I am starting my first year (in college) in Computer Science next year and I write mostly in C (if that is to matter). I have tried searching but most of what I find assumes knowledge of lambda ...
11
votes
1answer
581 views

What Is λ-calculus essentially?

I have what I would call a philosophical question about λ-calculus. When you explore λ-calculus you will be surprised to see all the things that you can do there. You can define integers, arithmetic ...
-1
votes
2answers
127 views

Is 'lazy' the correct term for timestamp-based skipping? [closed]

(1) The oldmakeutility looks at timestamps, and if the output is newer than the input, it skips (pointless, time-consuming) re-compilation of e.g. C files. The same is true for many languages and ...
2
votes
1answer
300 views

Implementation of chess endgame engine without Endgame Tablebases

I'm interested in creating an chess endgame solving engine. The endgames in chess are usually solved using the endgame table-bases generated by retrograde algorithm. I have found that Artificial ...
1
vote
2answers
433 views

The physical implementation of quantum annealing algorithm

From that question about differences between Quantum annealing and simulated annealing, we found (in comments to answer) that physical implementation of quantum annealing exists (D-Wave quantum ...
8
votes
3answers
360 views

How many copies are needed to enlarge an array?

I am reading an analysis on dynamic arrays (from the Skiena's algorithm manual). I.e. when we have an array structure and each time we are out of space we allocate a new array of double the size of ...
78
votes
11answers
7k views

How can I make sure that I'm actually learning how to program rather than simply learning the details of a language? [closed]

I often hear that a real programmer can easily learn any language within a week. Languages are just tools for getting things done, I'm told. Programming is the ultimate skill that must be learned and ...
0
votes
1answer
114 views

How are the conceptual pairs Abstract/Concrete, Generic/Specific, and Complex/Simple related to one another in software architecture?

(= 2 (+ 1 1)) take the above. The requirement of the '=' predicate is that its arguments be comparable. Any two structures are comparable in this case, and so the contract/requirement is pretty ...
0
votes
3answers
828 views

What is Atomicity?

I'm really struggling to find a concrete, easy to grasp, explanation of Atomicity. My understanding thus far is that to ensure an operation is atomic you wrap the critical code in a locker. But ...
1
vote
1answer
205 views

Which Computer Vision / Image Processing technique would solve light imbalance in images?

Given a colour image whose light intensity is dim at the edges and bright in the middle, such as [dim bright dim], which computer vision technique would be recommended to correct this imbalance? ...
1
vote
1answer
303 views

Can we still consider that Moore's law still holds true regarding the consequence on CPU speed? [closed]

Moore's law is an empirical law and in simple terms states that the number of transistors on integrated circuits doubles approximately every two years. One of the consequences of Moore's law is that ...
1
vote
4answers
305 views

What do you call a tree that grows in both directions? [closed]

What would be the technical term for a tree that grows in both the directions, starting from the root in the middle? The central idea being that new elements can be added to the tree (Now, I am not ...
0
votes
1answer
138 views

Difficulty implementing algorithms from abstract understanding [closed]

I've got decent programming experience for an undergraduate. I just started the study of algorithms. I read the description and saw visual examples that make perfect sense in my head. But when it ...
18
votes
6answers
1k views

What is an example of a computationally impossible business problem?

I have coworker who refuses to accept the reality that Turing machines (and Von Neuman machines by extension) cannot solve their own halting problem stating: You can do anything with enough time ...