computer-science

Can someone explain how Big-Oh works with Summations?

若如初见. 提交于 2019-12-01 00:29:06
问题 I know this isn't strictly a programming question, but it is a computer science question so I'm hoping someone can help me. I've been working on my Algorithms homework and figuring out the Big-Oh, Big-Omega, Theta, etc, of several algorithms. I'm proving them by finding their C and N 0 values and all is going well. However, I've come across my last two problems in the set and I'm struggling figuring out how to do them (and google isn't helping much). I haven't had to figure out the Big-Oh

Determining Floating Point Square Root

别等时光非礼了梦想. 提交于 2019-11-30 20:52:48
How do I determine the square root of a floating point number? Is the Newton-Raphson method a good way? I have no hardware square root either. I also have no hardware divide (but I have implemented floating point divide). If possible, I would prefer to reduce the number of divides as much as possible since they are so expensive. Also, what should be the initial guess to reduce the total number of iterations??? Thank you so much! When you use Newton-Raphson to compute a square-root, you actually want to use the iteration to find the reciprocal square root (after which you can simply multiply by

What does hysteresis mean and how does it apply to computer science or programming?

强颜欢笑 提交于 2019-11-30 18:19:41
I was looking at some code and saw an out of context comment about 'hysteresis.' I think I have figured out what the code does so my question doesn't involve anything specific. I simply do not understand what the term means or how it is applicable in programming. I looked around and saw some mathmatic definitions but would like some more information. From what I can tell Hysteresis has something to do with predicting or assuming a given state for X based on what has happened to X in the past? Hysteresis characterizes a system whose behavior (output) does not only depend on its input at time t

What's the difference between a boolean literal and a boolean value?

房东的猫 提交于 2019-11-30 16:04:34
问题 I can't seem to find a clear explanation as to what the difference is between these two. I'd also like to point out that I don't really understand the difference between literals and values either. Do boolean literals use the Boolean object? 回答1: A literal is a value you literally provide in your script, so they are fixed. A value is "a piece of data". So a literal is a value, but not all values are literals. Example: 1; // 1 is a literal var x = 2; // x takes the value of the literal 2 x = x

What is round-robin scheduling?

て烟熏妆下的殇ゞ 提交于 2019-11-30 13:53:27
问题 In a multitasking operating system context, sometimes you hear the term round-robin scheduling. What does it refer to? What other kind of scheduling is there? 回答1: Round Robin Scheduling If you are a host in a party of 100 guests, round-robin scheduling would mean that you spend 1 minute (a fixed amount) per guest. You go through each guest one-by-one, and after 100 minutes, you would have spent 1 minute with each guest. More on Wikipedia. There are many other types of scheduling, such as

What is the most active genetic programming library? [closed]

不想你离开。 提交于 2019-11-30 09:48:57
What genetic-programming library, regardless of language, has the most active community and is the most well developed? It's hard to tell, frankly. ParadisEO seems to be very active, and is a pretty large library encompassing various metaheuristics besides GP. Note that it is a superset of the EO library. OpenBEAGLE is nice, but it hasn't been updated since 2007. Watchmaker is very good and active right now, but it only has a proof of concept implementation of GP for now. There's a plethora of libraries out there and rather hard to tell which is the best one. And it's not very hard to roll

What is round-robin scheduling?

一曲冷凌霜 提交于 2019-11-30 08:56:15
In a multitasking operating system context, sometimes you hear the term round-robin scheduling. What does it refer to? What other kind of scheduling is there? Round Robin Scheduling If you are a host in a party of 100 guests, round-robin scheduling would mean that you spend 1 minute (a fixed amount) per guest. You go through each guest one-by-one, and after 100 minutes, you would have spent 1 minute with each guest. More on Wikipedia . There are many other types of scheduling, such as priority-based (i.e. most important people first), first-come-first-serve, earliest-deadline-first (i.e.

8-Puzzle Solution executes infinitely

荒凉一梦 提交于 2019-11-30 07:52:49
问题 This question was migrated from Software Engineering Stack Exchange because it can be answered on Stack Overflow. Migrated 7 years ago . I am looking for a solution to 8-puzzle problem using the A* Algorithm . I found this project on the internet. Please see the files - proj1 and EightPuzzle . The proj1 contains the entry point for the program(the main() function) and EightPuzzle describes a particular state of the puzzle. Each state is an object of the 8-puzzle. I feel that there is nothing

What is the difference between subtyping and inheritance in OO programming?

眉间皱痕 提交于 2019-11-30 07:08:05
问题 I could not find the main difference. And I am very confused when we could use inheritance and when we can use subtyping. I found some definitions but they are not very clear. What is the difference between subtyping and inheritance in object-oriented programming? 回答1: In addition to the answers already given, here's a link to an article I think is relevant. Excerpts: In the object-oriented framework, inheritance is usually presented as a feature that goes hand in hand with subtyping when one

Find k rectangles so that they cover the maximum number of points

旧城冷巷雨未停 提交于 2019-11-30 05:58:16
问题 In two dimensional space, given a bunch of rectangles, every rectangle covers a number of points and there may be overlap between two arbitrary rectangles, for a specified number K, how can i find the k rectangles such that their union cover the maximum number of points? In this problem, if a point is covered by more than two rectangles it is only counted once and we assume that the positions & size of rectangles and positions of points are fixed as given in the input. Can someone give me the