|
| |||||||
| http://www.narutomania.com/forums/New Month, New Problems |
| For these forums to remain up we need $480 within 7 days. Please donate HERE br> br> We need this amount no matter what to keep this website up. Thank you for your support. |
![]() |
| | Thread Tools |
06-10-2008, 11:44 AM
| #1281 |
| Raitei Join Date: Nov 2004 Location: Noway
Posts: 1,417
My Mood:
Rep Power: 21 ![]() ![]() |
Try google books
__________________ All I am about to do is strike you 8 times okay? |
| |
06-10-2008, 09:03 PM
| #1282 |
| ANBU Join Date: Nov 2004
Posts: 1,009
Rep Power: 18 ![]() | They don't give the full book... :( and they're pretty limited to what they can offer.
__________________ ![]() ![]() OH NO poor 360 :( |
| |
06-10-2008, 10:00 PM
| #1283 |
| Raitei Join Date: Nov 2004 Location: Noway
Posts: 1,417
My Mood:
Rep Power: 21 ![]() ![]() |
That is because the book isn't free will be hard to find an ebook version, if there is even one, which I doubt there is or google would have returned a pdf or two.
__________________ All I am about to do is strike you 8 times okay? |
| |
09-10-2008, 07:52 AM
| #1284 |
| A://Stocks |
Try searching torrent sites for ebooks. I've managed to find some books that were useful.
__________________ |
| |
09-10-2008, 08:33 AM
| #1285 | |
| ANBU Join Date: Aug 2006 Location: Cairo, Egypt
Posts: 1,602
My Mood:
Rep Power: 19 ![]() ![]() ![]() | Quote:
__________________ ^THANKS Meeda FOR THE AVA and SIGGY | |
| |
17-10-2008, 02:38 AM
| #1286 |
| Akatsuki |
C++ Part 1 (%60) You need to read infix expressions from the input infixFile (one expression per line) and produce the corresponding postfix expressions that you will save in file postfixFile. An example of an infix expression is the following: (12 + 3) * ( 9 – 74) + 34 / ((85 – 93) +(3 + 5) * 3) - 5 You have to parse this expression from left to right, identify the operands, the operators and the parentheses and ignore blanks. You will implement the infix to postfix conversion algorithm using a stack of operators and parentheses. You can use any stack implementation (i.e. array, linked-list, list, or STL). You should be able to handle syntactically wrong infix expressions using exceptions. In this case you should output a message on the postfixFile indicating the type of error (i.e. “missing right parenthesis”). Part 2 (%40) Now you need to evaluate each postfix expression using the stack algorithm described in class and place the results in the file resultFile. ---------------------------- #include <iostream> #include <stack> #include <vector> #include <sstream> #include <string> using namespace std; int main() { int resultFile; stack <string> op; vector<string> postfix; stack<int> number; string line,str; int evaluate_postfix(vector<string>& post,stack<int>& num1); int precedence(string str1); getline(cin,line); istringstream iss(line); while(!iss.eof()) { iss>>str; if(str=="+"||str=="-"||str=="*"||str=="/") // choose the operation { while(!op.empty()&&op.top()!="("&&precedence(str)> =precedence(op.top())) { postfix.push_back(op.top()); op.pop(); }// end while op.push(str); }// end if else if(str=="(") { op.push(str); } else if(str==")") { while(op.top()!="(") { postfix.push_back(op.top()); op.pop(); } op.pop(); } else { postfix.push_back(str); } }// End While while(!op.empty()) { postfix.push_back(op.top()); op.pop(); } resultFile=evaluate_postfix(postfix,number); cout<< " The result is: " << resultFile << endl; system("PAUSE"); return 0; }// end Main int precedence(string str) { if(str=="+"||str=="-") return 1; else if(str=="*"||str=="/") return 2; else return 0; } /* To evaluate Postfix we push any number onto the stack and tehn pop the last two numbers from the stack and apply the operand to them. */ int evaluate_postfix(vector<string>& postfix,stack<int>& num) { for(vector<string>::const_iterator ptr=postfix.begin();ptr!=postfix.end();++ptr) { if(*ptr!="+"||*ptr!="-"||*ptr!="*"||*ptr!="/") { int number; istringstream stm; stm.str(*ptr); stm>>number; num.push(number); } else { int arg2=num.top(); num.pop(); int arg1=num.top(); num.pop(); int result; if(*ptr=="+") result=arg1+arg2; else if(*ptr=="-") result=arg1-arg2; else if(*ptr=="*") result=arg1*arg2; else result=arg1/arg2; num.push(result); } } int i=num.top(); num.pop(); return i; } Am I doing it right?
__________________ ![]() ![]() thanks to Tom, ~Mrge and Simonarturo, EE |
| |
17-10-2008, 09:40 PM
| #1287 |
| Akatsuki |
How come when I compile this I enter an infix expression and when I evaluate it I get crazy numbers.
__________________ ![]() ![]() thanks to Tom, ~Mrge and Simonarturo, EE |
| |
19-10-2008, 06:58 PM
| #1288 |
| Genin Join Date: Mar 2007
Posts: 79
Rep Power: 0 ![]() | Code: Calculus Problem: A swimming pool is 60 ft. long by 30 ft. wide. Water is being pumped into the pool at 600 ft3/min. How fast is the depth of the water changing at the moment the depth is 3 ft? 6 ft? 7 ft? Vertical Cross-Sectional slice:
__________________ |
| |
19-10-2008, 08:02 PM
| #1289 | |
| Administrator | Quote:
__________________ | |
| |
19-10-2008, 08:38 PM
| #1290 | |
| Genin Join Date: Mar 2007
Posts: 79
Rep Power: 0 ![]() | Quote:
I got the part a, when the depth is 3 ft. V = (1/2)hw(b1+b2) Then i plugged in the numbers: 600 = (1/2)h(30)(30+10) and found dh/dt to be 4/5 or .8 ft/min at 3ft. I'm stuck on the last two problems, when the depth is 6 and 7 feet.
__________________ | |
| |
31-10-2008, 03:01 AM
| #1291 |
| Raitei Join Date: Nov 2004 Location: Noway
Posts: 1,417
My Mood:
Rep Power: 21 ![]() ![]() |
Solve x' - x^2 = 1 given x(0) = 1 It says it is seperable but I still can't understand how the fuck I am supposed to solve it, I was sick the day they lectured on that.... and I don't like the idea of seperating x from x... I just took a shot and guessed arctan x + pi ?
__________________ All I am about to do is strike you 8 times okay? |
| |
31-10-2008, 05:26 AM
| #1292 | |
| A://Stocks | Quote:
x' can also be written as dx/dy then seperate y to one side and x to the other side god I hope I'm not giving incorrect advice LOL
__________________ | |
| |
31-10-2008, 12:02 PM
| #1293 |
| Raitei Join Date: Nov 2004 Location: Noway
Posts: 1,417
My Mood:
Rep Power: 21 ![]() ![]() |
Yeah I used eulers to approximate it and apparently arctan x + C is the inverse function so x(t) = tan (t + C) and given the starting conditions x(t) = tan(t + 0.25pi)
__________________ All I am about to do is strike you 8 times okay? |
| |
18-11-2008, 06:34 AM
| #1294 |
| Hunter-nin |
Dear Krozar, Halp. I know you're in love with Poli Sci, and I'm writing a paper for it. Was wondering if you had any tips/info/insight on this question "Do you see evidence of your representative engaging in the types of public relations efforts that are part of “governing by campaigning”? In general, do you think members of Congress engage in more or less of these behaviors than presidents? Why?" I'm writing mine on Danny K. Davis from Illinois. I don't want you to do research for me and give me all the answers, I was just wondering what the question meant by, "Governing by campaigning." Thanks
__________________ ![]() |
| |
01-12-2008, 10:27 PM
| #1295 |
| Akatsuki |
can someone help me with this? Theory Problem (20 points) (a) A sorting algorithm is stable if duplicates retain their relative positions in the sorted sequence. For example, consider the following list of names: George Bush Al Gore Hillary Clinton Ronald Reagan Rick Lazio George W. Bush Ralph Nader If this list is sorted by last name only, then a stable sort will produce this list: George Bush George W. Bush Hillary Clinton Al Gore Rick Lazio Ralph Nader Ronald Reagan whereas an unstable sort might produce this list: George W. Bush George Bush Hillary Clinton Al Gore Rick Lazio Ralph Nader Ronald Reagan Which of the following sorts is stable: insertion sort, bubble sort, mergesort, quicksort? For each one, describe why it is or is not stable. (b) The preorder traversal of a binary tree is "A B C D E F G H I" and inorder traversal is "C D E B F A I H G". Draw the tree.
__________________ ![]() ![]() thanks to Tom, ~Mrge and Simonarturo, EE |
| |
03-12-2008, 03:16 AM
| #1296 |
| Academy Student Join Date: Nov 2008
Posts: 6
My Mood:
Rep Power: 0 ![]() |
This is for a project... For example: "It is better to be yourself than to be like everybody else." What others can you think of? |
| |
03-12-2008, 03:38 AM
| #1297 |
| Elite Jounin Join Date: Nov 2007 Location: England...one and only
Posts: 6,072
My Mood:
Rep Power: 17 ![]() ![]() ![]() |
^It would be better to know exactly what but whatever. "It's better to have loved and lost than to have never loved at all" "Rules are merely guidelines for wise men" (not to sure if this is the exact wording) "The best way to get over someone is to get unde rsomeone" (haha, couldn't resist) That's all i can think of in my tired state, the first two are legit, hope this short post helps. EDIT: I remembered one from a poem i read in school in year 11 (2 years ago, near on 3, wow) "Why run when you can walk?"
__________________ Last edited by The stig; 03-12-2008 at 03:40 AM. |
| |
16-12-2008, 12:22 AM
| #1298 |
| Akatsuki |
1. (12 points) DEREG AIRLINES uses the table below to find out what flights to take to get from one city to another. To city 1 To city 2 To city 3 To city 4 To city 5 From city 1 - - 305 278 - From city 2 101 - 234 176 - From city 3 076 005 - - - From city 4 432 901 675 - 765 From city 5 - 211 303 180 - The table says that there is no direct service from city 1 to cities 2 and 5, direct service from city 1 to city 3 on flight 305, direct service from city 1 to city 4 on flight 278 and so on. Travel between two cities can also be indirect. For example, to go from city 1 to city 5 we can take flight 278 to city 4 and the flight 765 to city 5. You have been hired by DEREG to help create a program that takes as input two city numbers and prints out what flight or series of flights link two cities. a. (3 points) Describe a C++ data structure you would use to store the table above. b. (6 points) Write a recursive function in C++ bool findroute(int from, int to, int flight[], int &size) that will return in the array flight the flight number or numbers that link two cities or an empty array if there is no path between them (size is the number of elements in the array). The function returns true if a path is found and false otherwise. (pseudo-code) c. (3 points) Discuss (DO NOT WRITE CODE) how you might modify or change your data structure in part a) to allow for more than one flight between cities. ::edit:: Gah, the table is messed up
__________________ ![]() ![]() thanks to Tom, ~Mrge and Simonarturo, EE |
| |
21-12-2008, 08:56 PM
| #1299 |
| Jounin Join Date: Aug 2006 Location: Sweden
Posts: 4,599
My Mood:
Rep Power: 27 ![]() ![]() ![]() ![]() ![]() |
We have a ordinary differential equation which is defined as: dx/dt + x^2 = x, solve it. I got so far as to get x(1-x)=e^c*e^t but how do I continue from there? I noticed there was some sort of 0 formula but I didn't get it.
__________________ |
| |
26-12-2008, 09:20 PM
| #1300 | |
| Medical-nin Join Date: Mar 2006
Posts: 754
Rep Power: 12 ![]() | Quote:
| |
| |