Với cấu trúc dữ liệu mô tả cho Stack:
typedef struct SElement
{
int Key;
SElement *Next;
} SOneElement;
typedef SOneElement *SSTACK;
Tìm mô tả chính xác cho hàm sau:
void SSDelete (SSTACK &SList)
{
while (SList != NULL)
{ SSTACK TempElement = SList;
SList = SList ->Next;
TempElement ->Next = NULL;
delete TempElement;
}
}