Posts
 
Reputation
Joined
Last Seen
Ranked #328
Strength to Increase Rep
+8
Strength to Decrease Rep
-2
79% Quality Score
Upvotes Received
21
Posts with Upvotes
20
Upvoting Members
14
Downvotes Received
5
Posts with Downvotes
4
Downvoting Members
5
20 Commented Posts
~132.05K People Reached
Favorite Tags
Member Avatar for Rose Aashii

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 …

Member Avatar for Ali_84
0
2K
Member Avatar for rupali

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, …

Member Avatar for jamie_13
2
48K
Member Avatar for hey_shishir
Member Avatar for jon_stahl

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.

Member Avatar for alexstone
0
400
Member Avatar for mithila
Member Avatar for dirt_bagz

[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.

Member Avatar for Soufiene
0
4K
Member Avatar for Wiki_Tiki

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^, …

Member Avatar for RhondaCos
0
2K
Member Avatar for hkhk106

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 …

Member Avatar for sumtaru
0
239
Member Avatar for newcountry

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.

Member Avatar for Netcode
0
521
Member Avatar for shomashoma

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.

Member Avatar for rajmitul
0
156
Member Avatar for scru

[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 …

Member Avatar for Student level
0
473
Member Avatar for noktasizvirgul
Member Avatar for ghimangi
0
136
Member Avatar for Dave Sinkula

[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.

Member Avatar for jephthah
0
6K
Member Avatar for johndory
Member Avatar for jainrani
0
137
Member Avatar for ProgrammersTalk
Member Avatar for bling_bling_vr6

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.

Member Avatar for kitf84
0
3K
Member Avatar for pduregi

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 …

Member Avatar for shrughes
0
173
Member Avatar for wonder87

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 …

Member Avatar for aashish.raina
0
374
Member Avatar for Alex Edwards

UML is stupid and should be avoided. And definitely shouldn't be studied and studied and studied and studied and studied...

Member Avatar for sidatra79
0
158
Member Avatar for blade_costic

All these long, self-indulgent answers when the first was sufficient.

Member Avatar for Narue
0
182
Member Avatar for #include<DAN.h>

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; …

Member Avatar for Duoas
0
5K
Member Avatar for efus
Member Avatar for pocku

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 …

Member Avatar for sarehu
0
254
Member Avatar for rhoit

You shouldn't roll your own linked lists. Use std::list or std::vector (since there's little reason for prefering linked lists).

Member Avatar for sarehu
0
139
Member Avatar for navyfalcon

OH GOD OH GOD OH GOD OH GOD OH GOD. Now I remember why I got an HP-49G.

Member Avatar for sarehu
0
369
Member Avatar for Alohavik
Member Avatar for Natique
Member Avatar for chute20

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 …

Member Avatar for chute20
0
122
Member Avatar for deepak@
Member Avatar for juma denice