Question: 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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
