thanks for this. i will have a look at it! :)
Type: Posts; User: muran_pling
thanks for this. i will have a look at it! :)
its ok guys, i got it working :)
stack <int> unionS(stack<int>& S, stack<int>& T)
{
stack <int> unionStack;
stack <int> unionStackFinal;
stack <int> unionStackFinal2;
ahh yes.. i understand now... thanks alot anon :)
did u mean something like this:
p.push_back('(');
p.push_back(')');
//THESE ARE ARE IN SEQUENCE
p.push_back('{');
p.push_back('}');
//THESE ARE ARE IN SEQUENCE
hi guys, im trying to complete a function where you have stack S and stack T. Both integer type and both have 4 elements in each stack which the elements are in ascending order (Top to bottom (eg..1...
Hi guys, i recieved a question for homework. I dont really understand what its asking me to do.
Question:
bool balanced(vector <char> p)
// Precondition: p[0]...p[n-1] contains n...
yeah i wrote those messages before i saw your hints... thanks man :)
hehehe hrmmmm, this will take forever to figure out .. ill get there! thanks heaps anyway man. appreciate the help :)
Edit: Ohhhh the exclamation mark must go in front of the equals sign ? and i...
Ok well, its actually only removing the last string. Its not removing the unwanted string.
this is what i came up with.. my code doesnt seem to be working now..
void remove_string(stack <string>& string_stack, string unwanted)
{
stack <string> temp_stack;
string...
what if it asks to use stack container?
Hi guys, just wondering how i would remove an unwanted string element from a string stack.
Example:
void remove_string(stack <string>& string_stack, string unwanted);
int main()
ok thanks mate! much appreciated :)
thanks spoon, it was those small changes that made it work!!
appreciate it :)
can u do it without the DO while loop ?
ok heres my problem..
1. if x is even, divide x by 2.
2. if x is odd, multiply x by 3 and add 1, and count 1 step.
3. Repeat steps 1 and 2 until you arrive at the number 1.
For example, if we...
ok all done! thanks guys :)
thanks mate! much clearer! :) will try it
wait so are you saying.. find out what for example... theres 29, 6 and 1981..
get the gcd for 29 and 6... which will equal 1...
then get the gcd for 1 and 1981 ?
this sounds about right!
thanks guys!!! i will try it out :) and let u know how i go
Hi guys, just wondering.. how would i work out how to get the greatest common devisor of THREE numbers...not two..but THREE numbers.
for example...
the greatest common devisors for number 29...
char number[] = "11110000"; ??
was that ment to replace int number[] = {1,1,1,1,0,0,0,0}; array ?
is there a way to get rid of the commers in the array so for example... 1,1,1,1,0,0,0,0 is inputed as 11110000 and still reads 4 1s ? i tryed it without commers and it reads there is only 1 1's in...
thanks for that. i will try work with it!!! much appreciated