1,684 Posted Topics

Member Avatar for apcxpc

Your base case would be a tree of height zero (with one node); your nth case would be a tree of height n, and you'd use strong induction. You could prove equality for the special case of a full tree -- unfull trees can be made into full trees by …

Member Avatar for ITgeneration
0
261
Member Avatar for Mahen
Member Avatar for shahid
Member Avatar for SpS

[QUOTE=chrisbliss18]It's funny, but almost all of sunnypalsingh's questions sound like questions that an idiot teacher would ask. Knowing the answer to such questions doesn't help anyone understand programming and definately doesn't help a programmer develop good technique.[/QUOTE] Actually, I have had this sort of question, and it was appropriate for …

Member Avatar for SpS
0
319
Member Avatar for SpS

I would feel more comfortable trusting sizeof(void*) than sizeof(int). I'm tempted to trust sizeof(size_t) too, but you never know...

Member Avatar for SpS
0
357
Member Avatar for Dmonkey

This tutorial is very bad, because it defecates code on the reader without teaching anything. And some of the code, like the image example, is wrong. Somebody who reads this tutorial would end up pushing buttons without knowing what he was doing. Also, the way there are, too many, commas, …

Member Avatar for peter_budo
0
125
Member Avatar for bumsfeld

[QUOTE=bumsfeld]Is const void* p the same as a null pointer? Why would i use it?[/QUOTE] No, that's a pointer named p. You might use it for holding the memory address of something. For example, memcpy takes a const void* argument.

Member Avatar for Ancient Dragon
0
236
Member Avatar for CypriotShero

Do something in a Unix-like operating system in a language different from C# that is not under a Microsoft framework. You'd learn a lot more that way, wouldn't you?

Member Avatar for Toulinwoek
0
190
Member Avatar for coolgirl

If you're using C++, sprintf is not the right tool. Now here's the answer. The second argument is a format string. The sprintf subroutine copies the format string to the bytes of memory pointed to by DirString. The thing is, it replaces "%s" with the contents of the string DirName. …

Member Avatar for winbatch
0
177
Member Avatar for ashwinperti

You need to be WAAAAAAAY more clear. Multiplication of two integers or floating point approximations is well-defined and everybody knows what you mean. Multiplication of arrays is not. Do you want to make a multiplication table? That's one interpretation, and since you mentioned a two-dimensional array, that seems possible. However, …

Member Avatar for Rashakil Fol
0
246
Member Avatar for server_crash

Yeah, it is basically the same thing as a class. Keeping 'struct' in the language kept C++ a near-superset of C, since C contained structs. The real mystery to me is why they added 'class' in the first place. I guess it was to make the language seem more object-oriented.

Member Avatar for server_crash
0
164
Member Avatar for hider

#1: Are you just guessing? The answer is yes, but it also is no. #2: This is a question?

Member Avatar for Rashakil Fol
0
309
Member Avatar for SpS
Member Avatar for Paul.Esson
0
133
Member Avatar for Gotcha

If actual thinking fails, run through the code by hand for various values of N and notice a pattern.

Member Avatar for Rashakil Fol
0
129
Member Avatar for Mohieddine
Member Avatar for MIGSoft

There are various text justification algorithms, some better than others. For example, one simply asks, "How many words can I fit on the first line?" and then spreads those words evenly on the first line. Then it looks at the rest of the words. A smart text justification algorithm does …

Member Avatar for Rashakil Fol
0
743
Member Avatar for vjw757

It depends on your personality. I figure that after learning C++ you're likely to have more of an idea of what is [i]really[/i] going on in your computer program than you are with Java. Since I was uncomfortable without that knowledge, C++ was a better match for me than Java …

Member Avatar for chrisbliss18
0
439
Member Avatar for m7r23
Member Avatar for winbatch
Member Avatar for nir_kar

If you say 2*x, compilers will generally use the same code as x << 1. They're smart enough for that.

Member Avatar for chrisbliss18
0
170
Member Avatar for bonstubon

Make a chess playing program. You could make one in 3 days, but with a whole year you could try making it learn.

Member Avatar for Dortz
0
107
Member Avatar for paradox814

Since [font=monospace]this[/font] is a pointer to the object, [font=monospace]*this[/font] dereferences this pointer.

Member Avatar for Rashakil Fol
0
93
Member Avatar for djbsabkcb

The "two way" part of its name means that you can iterate in both directions. That is, if you have an iterator pointing at a particular element of the list, you can move the iterator to the previous element or to the following element. Other styles of linked lists are …

Member Avatar for djbsabkcb
0
133
Member Avatar for kained

Also, I recommend learning about the use of 'classes' and 'ids' involving CSS, since trying to use CSS without classes or ids is like trying to play the piano without any fingers.

Member Avatar for Rashakil Fol
0
187
Member Avatar for Gotcha

There are many 'big Oh's for these functions. In particular, in each case, f(n) is in O(f(n)).

Member Avatar for Daishi
0
85
Member Avatar for SpS

If you use an actual array, &array[0] is just a weird way of saying array. [code]#include <iostream> class hiddenaddr { public: void* operator &()const { return NULL;} }; class noaddrop { private: void* operator &()const; }; int main() { hiddenaddr x[1]; std::cout << ((char *)(x + 1)) - ((char *) …

Member Avatar for Stoned_coder
0
444
Member Avatar for sydneyrustle
Member Avatar for Phantom Driver

An error record is a record of an error. Consider, for example, a web server. Some errors can happen, such as a File Not Found error, or a Permanent Redirect. You need to create a structure that holds this sort of error. Apache would store these errors in a log …

Member Avatar for Rashakil Fol
0
133
Member Avatar for winbatch
Member Avatar for bsdpowa

First of all, you passed p_beginning to the function and then tried to use k_beginning. Your code compiles? Second, you expect us to have a crystal ball that can read your mind. What does "add_before_element" mean? Do you want to add before the element containing 'number'? Or do you want …

Member Avatar for bsdpowa
0
369
Member Avatar for higherGround574
Member Avatar for l3.azarmehr
0
93
Member Avatar for ayk-retail
Member Avatar for yaniv

There is no practical purpose for this. Therefore, this is a homework problem. Therefore, show what you've tried, and if you demonstrate thought, you might get help.

Member Avatar for yaniv
0
2K
Member Avatar for Rete

Suppose you have the scrambled string, "urcoppnei". You want to be able to quickly go from scrambled string to unscrambled. How? Sort the letters of the string in increasing order. That gives us "ceinoppru". Now take every word in the dictionary, and sort their letters in increasing order. Put this …

Member Avatar for G-Do
0
171
Member Avatar for winbatch

You can't change the ordering of a map. You want to copy the contents of your map to a datatype such as a vector, and then sort the vector by the value. You can do this using iterators.

Member Avatar for winbatch
0
327
Member Avatar for Mahen

Think carefully about how you store your data; and use floats when doubles aren't needed, shorts and chars when they suffice; and avoid memory leaks; and perhaps trade running time for memory. Process files incrementally instead of loading them all at once, whenever you can.

Member Avatar for Drowzee
0
175
Member Avatar for winbatch
Member Avatar for winbatch
0
119
Member Avatar for rkahn144

[quote=rkahn144]I want to take control of my visitors' computers.[/quote] Write a Web browser that supports this somehow, and then ask your users to download this Web browser, and see if they like it.

Member Avatar for Rashakil Fol
0
116
Member Avatar for nametso

#1 has a solution but #2, without a set of base cases, is only solvable (I assume the "solution" that you want is for T to be defined in closed form) for one value of n.

Member Avatar for Rashakil Fol
0
82
Member Avatar for server_crash

[QUOTE=server_crash]Anyways, I'm just plain sick of hearing about it. It's all over the news. I just don't get why that women and other people let the war have so much affect on them. Why don't they let it go, support what's going on and shut up?[/QUOTE] Absolutely, man! Ignorance is …

Member Avatar for bluedos82
0
669
Member Avatar for NubKnacker

For convenience, let f(n) = 6 * (2 ^ n) + n ^ 2. What is this really saying? For all values of n that are reasonably large (greater than n0), show that f(n) is bounded by two multiples of g(n). Then c1 <= f(n) / g(n) <= c2. In …

Member Avatar for NubKnacker
0
914
Member Avatar for Arizona Web

This article said, "Lots of people use HTML incorrectly, so therefore, use XHTML!" There's a gaping hole in that argument. Coding HTML to the standards while closing closable tags is just as effective as using XHTML. Not that there's anything wrong with XHTML. But this particular argument is rather flaky.

Member Avatar for Rashakil Fol
0
446
Member Avatar for Daishi

Suppose you've got [code]for (i = 0; i < N + 1; ++i) { for (j = 0; i < N - 2; ++j) { some_constant_time_function(i,j); } }[/code] The total number of times some_constant_time_function() would be called is (N + 1)*(N - 2), is it not? Which expands to N^2 …

Member Avatar for Daishi
0
128
Member Avatar for sara.rythm

[QUOTE=Drowzee]the answer to number 3 (assuming the number is an integer) is to use the modulous operator, %. [code] if(!(numbername%2)) cout<<numbername<<" is a power of 2."<<endl; [/code][/QUOTE] Um, no. This only tells if the number is a [i]multiple[/i] of 2. For power of 2, that'd be (!(x & (x - …

Member Avatar for Dave Sinkula
0
943
Member Avatar for shashankk

[QUOTE=shashankk]Can anyone pl. mail turbo c++ setup as attachment to[/QUOTE] I would recommend free software that exists and you can use for free, but you don't deserve it.

Member Avatar for kc0arf
0
386
Member Avatar for apcxpc

Use 1 and c as your starting points; they'll always work, because the square root will always be between them. You can't really pick any fraction of c, like c/2, without testing its resulting sign first. And if you do that, well, you've already started the bisection process. So 1 …

Member Avatar for apcxpc
0
184
Member Avatar for sunandoghosh

Maybe try writing down only the things you need to remember. It's not like you need to record a transcript of the lecture.

Member Avatar for Catweazle
0
382
Member Avatar for cjm771

I suppose you'll run into problems if the word ends up being "superconductors", or "Lackawannanians", or "indistinguishable", or "incomprehensible".

Member Avatar for cjm771
0
4K
Member Avatar for lemkam

[QUOTE=lemkam]I've got a bit of a problem that I could use some help with. There appear to be an extensive number of sites that are linking to mine, but are using an incorrect link to do so. Aside from searching Google, Yahoo, etc. with the phrase "link:www.mysite.org" and then checking …

Member Avatar for mmiikkee12
0
106
Member Avatar for iamthwee

[QUOTE=iamthwee]Hi everione, my next assinement is 2 do with classes. I dun no what they are tho and why u will use them? Can any1 explain them to me I would B greatfull.[/QUOTE] You're taking a class and you want us to do work for you because you didn't feel …

Member Avatar for proghelper
0
383

The End.