Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Algorithm understanding and design questions 1Read the following procedure, which is an in stack operation of the chain stack, and fill in the correct statement
Algorithm understanding and design questions
1Read the following procedure, which is an in stack operation of the chain stack, and fill in
the correct statement at the horizontal line.
LineStack* push(LineStack * stack, int q)
{
LineStack * line = (LineStack*)malloc(sizeof(LineStack));
line->data = q;
return stack;
}
2. This procedure is to delete the j-th element in the bidirectional linked list with head node,
please fill in the correct statement at the horizontal line.
int ListDelete_DuL(DuLinkList &L, int j)
{
if (!(p == GetElem_DuL(L, j))) // Determines the position pointer p of the j-th
element in L
return -1;
delete p;
return 0;
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started