computer-science

Is Quicksort in-place or not? [duplicate]

Deadly 提交于 2019-12-03 03:37:54
问题 This question already has answers here : Is imperative Quicksort in situ (in-place) or not? (2 answers) Closed 5 years ago . So the space efficiency of Quicksort is O(log(n)). This is the space required to maintain the call stack. Now, according to the Wikipedia page on Quicksort, this qualifies as an in-place algorithm, as the algorithm is just swapping elements within the input data structure. According to this page however, the space Efficiency of O(log n) disqualifies Quicksort from being

What are some good computer science resources for a blind programmer?

拟墨画扇 提交于 2019-12-03 03:32:52
问题 I'm a totally blind individual who would like to learn more of the theory aspect of computer science. I've had an intro data structures class and the general intro programming but would like to learn more on things such as software design, advanced data structures, and compiler design. I want to do this as a self study course not as part of college classes. Unfortunately there aren’t many text books available on computer science from Recordings for the Blind and Dyslexic where I normally get

Simple definition of “semantics” as it is commonly used in relation to programming languages/APIs?

痞子三分冷 提交于 2019-12-03 03:04:18
It occurred to me today that although I've adopted and don't infrequently use the term "semantics" when referring to language elements and naming conventions, I don't have any sense of a formal definition. My attempt to find a formal definition in the programming domain made my eyes glaze over. I have a sense of its meaning from the contexts in which I've encountered it, and from its more common usage with respect to linguistics, and I typically use the term to refer to the meaning or expressiveness of the language element, or the fidelity of nomenclature to the intent, behaviour, or function

What does “in constant time” imply?

偶尔善良 提交于 2019-12-03 02:44:46
问题 I work as a programmer, but have no computer science background, so recently I've been following along with the excellent MIT OpenCourseWare intro to Computer Science and Programming. In the course of which, the question is asked: "will any program written using only function definitions and calls, the basic arithmetic operators, assignment and conditionals run in constant time?" I thought the answer was yes, since all of these operations seem pretty simple. But as you smart people probably

Why Two's Complement?

安稳与你 提交于 2019-12-03 02:08:45
I'm writing a tutorial to teach kids (ages 9 to 13) about programming. I started with computers themselves, they don't have that much to do with computer science, it's more about the process involved with a solution to a computational problem. With that starting point, I'm guiding them toward an understanding that machines can help us with certain computational problems. People are great at abstract thinking and imagination, but computers are AWESOME at following a well-specified routine. They can do it again and again, at amazing speed! Representing numbers in binary format has already been

Abstract algebra and Programming [closed]

為{幸葍}努か 提交于 2019-12-03 01:56:29
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . I am going to start learning Abstract Algebra- Groups, Rings,etc. I am interested to know any programming language, if at all which can help me learn/try the concepts I learn in theory. EDIT: I am not really looking at implementing what I learn. I am interested to know any language which already supports them. 回答1

Is number comparison faster than string comparison?

倾然丶 夕夏残阳落幕 提交于 2019-12-03 01:37:08
I heard that hashing (ie converting a string or object to a number) is used for strings and such because it is easier to compare numbers than strings. If true, what is the reason for this ? This is not necessarily the case, but probably the case most of the time. Consider the following situation: I want to compare the string "apples" vs. "oranges". If I only want to determine "apples" == "oranges", I need only compare the first character of each string: 'a' != 'o' => "apples" != "oranges". If I hash the string and then do the comparison, it is significantly slower as I have to parse both

What is a finite state transducer?

浪子不回头ぞ 提交于 2019-12-03 00:53:35
问题 Can someone please tell me what a finite state transducer is? I have read the Wikipedia article and don't understand a thing. 回答1: A finite state transducer (FST) is a finite state automaton (FSA, FA) which produces output as well as reading input, which means it is useful for parsing (while a "bare" FSA can only be used for recognizing, i.e. pattern matching). An FST consists of a finite number of states which are linked by transitions labeled with an input/output pair. The FST starts out in

Exactly what is the difference between a “closure” and a “block”?

杀马特。学长 韩版系。学妹 提交于 2019-12-03 00:33:28
问题 I've found that lots of people use the words closure and block interchangeably. Most of these people can't explain what they're talking about. Some Java programmers (even ones from really expensive consultancies) talk about anonymous inner classes as "blocks" and "closures" - but I know this isn't true. (You can't pass mutable variables in from the scope of the method in which they're defined...) I'm looking for: a precise, computer science definition of a block a precise, computer science

What is an SSTable?

人走茶凉 提交于 2019-12-03 00:31:30
问题 In BigTable/GFS and Cassandra terminology, what is the definition of a SSTable? 回答1: Sorted Strings Table (borrowed from google) is a file of key/value string pairs, sorted by keys 回答2: "An SSTable provides a persistent,ordered immutable map from keys to values, where both keys and values are arbitrary byte strings. Operations are provided to look up the value associated with a specified key, and to iterate over all key/value pairs in a specified key range. Internally, each SSTable contains a