computer-science

What are strongly connected components used for?

百般思念 提交于 2019-12-03 10:45:37
I have found several algorithms that explain how to find strongly connected components in a directed graph, but none explain why you would want to do this. What are some applications of strongly connected components? You should check out Tim Roughgarden's Introduction to Algorithms course on Coursera. For every algorithm he goes over, he explains some applications of it. Very useful, and makes one see the value of studying algorithms! The use of strongly connected components that I remember him saying is that one could use it to find groups of people who are more closely related in a huge set

NP-hard problems that are not NP-complete are harder?

你说的曾经没有我的故事 提交于 2019-12-03 10:44:51
问题 From my understanding, all NP-complete problems are NP-hard but some NP-hard problems are known not to be NP-complete, and NP-hard problems are at least as hard as NP-complete problems. Is that mean NP-hard problems that are not NP-complete are harder? And how it is harder? 回答1: To answer this question, you first need to understand which NP-hard problems are also NP-complete. If an NP-hard problem belongs to set NP, then it is NP-complete. To belong to set NP, a problem needs to be (i) a

What are futures?

孤街醉人 提交于 2019-12-03 10:35:45
What are futures? It's something to do with lazy evaluation. Motti There is a Wikipedia article about futures. In short, it's a way to use a value that is not yet known. The value can then be calculated on demand (lazy evaluation) and, optionally, concurrently with the main calculation. C++ example follows. Say you want to calculate the sum of two numbers. You can either have the typical eager implementation: int add(int i, int j) { return i + j; } // first calculate both Nth_prime results then pass them to add int sum = add(Nth_prime(4), Nth_prime(2)); or you can use the futures way using C+

Garbage Collection

北城余情 提交于 2019-12-03 09:48:51
问题 I am not able to understand few things on the Garbage collection. Firstly, how is data allocated space ? i.e. on stack or heap( As per my knowledge, all static or global variables are assigned space on stack and local variables are assigned space on heap). Second, GC runs on data on stacks or heaps ? i.e a GC algorithm like Mark/Sweep would refer to data on stack as root set right? And then map all the reachable variables on heap by checking which variables on heap refer to the root set. What

What is the difference between Dataflow programming and Reactive programming?

核能气质少年 提交于 2019-12-03 09:27:09
问题 I really can't see the difference between them. They are both about data flowing through instructions and the propagation of changes in the input data. I've read this book (authored by Matt Carcki) and it clearly says that the are both the same. On the other hand the wikipedia establish Reactive programming as a form of Dataflow programming and this stackoverflow answer does it too. So, what is the conceptual difference between Reactive programming and Dataflow programming? 回答1: Reactive

comparisons of data structures, algorithms, basic computer science, online resources

本秂侑毒 提交于 2019-12-03 08:51:56
问题 I am searching for an online resource referring to data structures and algorithms. Basicaly what I am interested in, is a kind of comprehensive list of things such as: when a data structure or algorithm is used, pros and cons compared to each other, real life-problem usage, etc. I have a couple of popular books on the subject, like "introduction to algorithms" and "algorithm design manual", and have found code implementations of various data structures and algorithms online. But what I can't

In Natural language processing, what is the purpose of chunking?

試著忘記壹切 提交于 2019-12-03 08:46:10
问题 In Natural language processing, what is the purpose of chunking? 回答1: Chunking is also called shallow parsing and it's basically the identification of parts of speech and short phrases (like noun phrases). Part of speech tagging tells you whether words are nouns, verbs, adjectives, etc, but it doesn't give you any clue about the structure of the sentence or phrases in the sentence. Sometimes it's useful to have more information than just the parts of speech of words, but you don't need the

Do invariant assertions fit into C# programming?

心不动则不痛 提交于 2019-12-03 08:12:20
In the book coders at work , the author asks "How do you use invariants in your code". Please explain what this question means. I saw class invariants on wiki , but the example is in Java and I am not skilled enough in Java to relate this example to C#. .NET 4.0 introduces invariance, covariance, and contravariance and is well explained here. Invariance is so broad. The authors usage of the word seems unit test related. For those that read the book, what does the author mean? Are we talking about making an assumption and simply testing the validity after the unit test? The word invariant doesn

Do theoretical computer science topics have “real world” development applications?

雨燕双飞 提交于 2019-12-03 05:53:05
问题 By "theoretical computer science topics", I am referring to things such as regular vs non-regular languages, the pumping lemma, and grammars. I'm familiar with the real world applications of finite automata and regular expressions, but topics such as these other ones are giving me more problems as I'm not seeing any real world applications. 回答1: These things are useful if you want to know whether trying to do something is futile with regular expressions. For example, knowing that XML is non

Programming from scratch [closed]

偶尔善良 提交于 2019-12-03 05:02:15
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 years ago . What I would like to know is to start programming from scratch without any Operating System and anything like it. As I know Windows and Mac and almost anything even the DOS is written in C, C++ Pascal etc., so I think I should know one of these languages, but for this I would need