Create an abstract class called AR whose objects will be activation records. Act
ID: 3715108 • Letter: C
Question
Create an abstract class called AR whose objects will be activation records. Actual activation records for function calls will be objects of subclasses of AR. Emulation of activation records of the factorial function and the runtime stack can be achieved by the following subclass of AR called ARfact:
i want to create the same method for quick sort as it mention above. can someone help me to change following quicksort method as same Activation Record method as mention above ?
Create an abstract class called AR whose objects will be activation records. Actual activation records for function calls will be objects of subclasses of AR. Emulation of activation records of the quick sort function and the runtime stack can be achieved by converting the following qiuck sort method into activation record
:
Explanation / Answer
abstract AR
{
void quicksort();
int partition();
}
class ARquicsort extends AR
{
int p,r;
int returnval,A[];
int quicksort(int A[],int p,int r){
if(p<r){
returnval=1;
RuntimeStack.display();
quicksort(A,p-1,r);
}
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.