- Strength to Increase Rep
- +8
- Strength to Decrease Rep
- -2
- Upvotes Received
- 21
- Posts with Upvotes
- 20
- Upvoting Members
- 14
- Downvotes Received
- 5
- Posts with Downvotes
- 4
- Downvoting Members
- 5
Re: Do you mean o(log n) or O(log n)? They mean different things. An algorithm will be O(log n) if there's some value C and some value m such that given an input of size n, where n>m, the running time will be less than C*(log n). And similarly for O(n … | |
Re: For [i]any[/i] function? Here's a tip: For any function f, f(n) = O(f(n)). It's true! He he he. Now, given T(1) = 1 and T(n) = 2T(n/4) + 1, you can find the order of growth using the Master theorem. One way, though, to think about the above problem intuitively, … | |
Re: Output buffers are flushed on program exit anyway... | |
Re: php.net should be avoided. It is fully of buggy and security-hole ridden examples. No, I don't have an example of this, I don't feel like going back and looking them up again. | |
Re: It's O(square root of n), not o(square root of n). | |
Re: [QUOTE=ithelp;487462]It is an NP complete problem , so you can only get some approximation algorithm to get it faster.[/QUOTE] No it's not. Learn what NP complete means. Learn what NP means. This problem isn't even in NP. | |
Re: This isn't really a C++ question, more of a C++/CLI question, which is a separate language. But if you looked in the System.String documentation, you'd see the answer: [url]http://msdn.microsoft.com/en-us/library/ezh7k8d5.aspx[/url] Your real problem is that you're using std::string in the first place -- if you're going to be creating a System::String^, … | |
Re: Don't start him with C++ (I mention this because you posted in the C++ forum). I remember trying to learn C++ in high school on my own; it was horrible, mainly because it has quite a bit of complexity whose purpose doesn't become clear immediately. It did not help that … | |
Re: Overloading is one thing, and polymorphism is another. Look at the definitions on the internet and then use thinking to figure how they are related and unrelated. | |
Re: shomashoma, remember that two sets S and T are equal if S is a subset of T and T is a subset of S. You know that the set of regular languages are those accepted by DFAs and NFAs. Hint hint. | |
Re: [QUOTE=scru;497101]Question's still open for anyone who might know an inline solution.[/QUOTE] There is [icode]x ? 1 + static_cast<int>(floor(log10(static_cast<double>(x)))) : 1;[/icode], but that solution is dumb (and doesn't consider negative numbers). I say it's dumb because casting to double means you have to deal with precision issues, and because it is … | |
Re: Have you ever actually had problems with people decompiling your code? | |
Re: [QUOTE=Ene Uran;505239]Call me young and foolish, but I really like Barack Obama, even though he is called a baby murderer because of his stance on abortion. Wonder if this country will ever get past single silly issues.[/QUOTE] Murder is not a silly issue. | |
| |
Re: The trouble with that algorithm is that it doesn't uniformly select all the possible combinations of numbers; it's biased. The trouble with vijayan's algorithms is that they rely on walking through all the possible numbers one must select from, which is slow. | |
Re: And here are some naive answers. 1. Type checking proves properties about the code. The compiler proves your assertion that your function returns an int, or that it returns something whose type depends on the types of the arguments in some way. They can also prove other claims you make … | |
Re: You assure that the algorithm works by proving it works. For recursive functions (and oftentimes, for things like while loops), you can prove the function works with the following sort of strategy: 1. Prove this fact: It works when n = 0. 2. Prove this fact for any positive integer … | |
Re: UML is stupid and should be avoided. And definitely shouldn't be studied and studied and studied and studied and studied... | |
Re: All these long, self-indulgent answers when the first was sufficient. | |
Re: That depends on the libraries you're using. The standard library also lets you output to files and to the stderr output stream. Other libraries exist that let you make windows in the windowing system and send text over a network. What you can use depends on what you have installed; … | |
Re: You can always do a replacement that produces a bigger value, when finding a big O bound. For example, consider: [code] i = 1 while i < n { for j in (0..i) { print j } i = i * 2 } [/code] We can note that the running … | |
Re: You shouldn't roll your own linked lists. Use std::list or std::vector (since there's little reason for prefering linked lists). | |
Re: OH GOD OH GOD OH GOD OH GOD OH GOD. Now I remember why I got an HP-49G. | |
Re: People won't want to waste their time giving help to somebody who won't put in a good effort in what they do -- so they think their help will be wasted. When you can't even put in the effort to write something with reasonable punctuation, it's a good rule of … | |
Re: You should use whatever you're most familiar with. |