| | |
application of stacks.
Please support our Computer Science advertiser: Learn about neural networks and artificial intelligence.
Thread Solved |
i have this question..
show the state of the stack and the value of each variable after execution of the following statements.
let A=5, B=3, C=7
push A onto stack
push C*C onto stack
pop item fron the stack and store in B
push B+A onto stack
pop item from the stack and store in A
pop item for the stacj and sotore in B
-------------------------------------
what will be the value of B after C*C is popped out of the stack?? will the predefined value of B be overwritten?? and what if B is pushed onto the stack, will the value of the pushed B be the value of the result of C*C??
for example..
this???
push A onto stack = 5
push C*C onto stack = 49
pop item fron the stack and store in B = B=49
push B+A onto stack = 49+5=54
pop item from the stack and store in A = A=54
pop item for the stacj and sotore in B = B=5
??????????????????????
or this??
push A onto stack = 5
push C*C onto stack = 7*7=49
pop item fron the stack and store in B = B=49
push B+A onto stack = 3+5=8
pop item from the stack and store in A = A=8
pop item for the stacj and sotore in B = B=5
???????????????????/
HELP
show the state of the stack and the value of each variable after execution of the following statements.
let A=5, B=3, C=7
push A onto stack
push C*C onto stack
pop item fron the stack and store in B
push B+A onto stack
pop item from the stack and store in A
pop item for the stacj and sotore in B
-------------------------------------
what will be the value of B after C*C is popped out of the stack?? will the predefined value of B be overwritten?? and what if B is pushed onto the stack, will the value of the pushed B be the value of the result of C*C??
for example..
this???
push A onto stack = 5
push C*C onto stack = 49
pop item fron the stack and store in B = B=49
push B+A onto stack = 49+5=54
pop item from the stack and store in A = A=54
pop item for the stacj and sotore in B = B=5
??????????????????????
or this??
push A onto stack = 5
push C*C onto stack = 7*7=49
pop item fron the stack and store in B = B=49
push B+A onto stack = 3+5=8
pop item from the stack and store in A = A=8
pop item for the stacj and sotore in B = B=5
???????????????????/
HELP
•
•
Join Date: Feb 2009
Posts: 3
Reputation:
Solved Threads: 1
They want you to show the state of the stack, ie what's in it.
So more like
push A onto stack [5]
push C*C onto stack [49,5]
...
So more like
push A onto stack [5]
push C*C onto stack [49,5]
...
•
•
Join Date: Sep 2009
Posts: 4
Reputation:
Solved Threads: 0
•
•
•
•
i have this question..
show the state of the stack and the value of each variable after execution of the following statements.
let A=5, B=3, C=7
push A onto stack
push C*C onto stack
pop item fron the stack and store in B
push B+A onto stack
pop item from the stack and store in A
pop item for the stacj and sotore in B
-------------------------------------
what will be the value of B after C*C is popped out of the stack?? will the predefined value of B be overwritten?? and what if B is pushed onto the stack, will the value of the pushed B be the value of the result of C*C??
for example..
this???
push A onto stack = 5
push C*C onto stack = 49
pop item fron the stack and store in B = B=49
push B+A onto stack = 49+5=54
pop item from the stack and store in A = A=54
pop item for the stack and store in B = B=5
??????????????????????
or this??
push A onto stack = 5
push C*C onto stack = 7*7=49
pop item fron the stack and store in B = B=49
push B+A onto stack = 3+5=8
pop item from the stack and store in A = A=8
pop item for the stacj and sotore in B = B=5
???????????????????/
HELP
your first example
ie
push A onto stack = 5
push C*C onto stack = 49
pop item fron the stack and store in B = B=49
push B+A onto stack = 49+5=54
pop item from the stack and store in A = A=54
pop item for the stack and store in B = B=5
is definetly right..ok
![]() |
Similar Threads
- how to run 32 bit application on 64 bit os (Windows NT / 2000 / XP)
- Frozen forms on another thread (C#)
- Data Structure help (stacks) (Java)
- C++ and data access (C++)
- Dell Latitude D620 , stacks with initial booting process (Motherboards, CPUs and RAM)
- Is assembly worth learning it? (Assembly)
- binary integer logic (Computer Science)
- Given two queues, can we implement a stack (C)
- question on Stacks push,pop. (C++)
- Pointers (C++)
Other Threads in the Computer Science Forum
- Previous Thread: UK looks for bite of 110 million CERN contract cherry
- Next Thread: File Structure , PLease help thanks.
Views: 1501 | Replies: 4
| Thread Tools | Search this Thread |
Tag cloud for Computer Science
ai algorithm algorithms amazon assignment assignments automata battery binary bizarre bletchleypark blogging bomb business cern clueless codebreaker compiler computers computerscience computertrackingsoftware connect csc data dataanalysis dataintepretation development dfa dissertation dissertations dissertationthesis dissertationtopic ebook energy extensions floatingpoint foreclosure foreclosuresoftware fuel gadgets geeks givemetehcodez government graphics hardware history homeowners homework homeworkassignment homeworkhelp humor ibm idea internet iphone ipod itcontracts laws lazy linkbait lsmeans mainframes marketing mining mobileapplication msaccess nano netbeans networking news os p2p parser piracy piratebay principles programming rasterizer research sam-being-cute sas science sex spoonfeeding sql stephenfry student study supercomputer supercomputing sweden technology textfield tree turing turingtest uk virus warehouse ww2






