Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Draw a simple graph showing the methods in stack for each of the check point in the table below, when a calling sequences is given

Draw a simple graph showing the methods in stack for each of the check point in the table below, when a calling sequences is given as: main calls m1 then calls m2; m1 calls m3; m2 and m3 does not call any other method. You dont need to worry about the grammar syntax of each method, since these methods are not necessarily written in Java.

Check point 1: after main is executing, before main calls m1;

Check point 2: after main calls m1, m1 not calling m3 yet;

Check point 3: after m1 calls m3, m3 not finished yet;

Check point 4: after m1 calls m3, m3 already finished;

Check point 5: after main finishes calling m1, before main calls m2;

Check point 6: after main calls m2, m2 not finished yet.

Check point 7: after main calls m2, m2 already finished.

Check point 8: after main itself finishes execution

void main(){

.

m1();

m2();

..

}

void m1(){

..

m3()

..

}

void m2(){

}

void m3(){

}

The sign in the above table indicate here goes some code. The parameters of each method are omitted to save space, and the access modifier are also omitted in each method. Assume the above method invocations are valid. The syntax of the above methods are not necessarily in Java.

Now you need to draw of the stack diagram for the rest of the scenarios.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Logistics Lifeline Supply Chain Strategies

Authors: Ehsan Sheroy

1st Edition

7419377502, 978-7419377503

More Books

Students also viewed these Databases questions

Question

10. Describe the relationship between communication and power.

Answered: 1 week ago