220 câu trắc nghiệm Cấu trúc dữ liệu và giải thuật có đáp án - Phần 3

Với cấu trúc dữ liệu mô tả cho Stack: typedef struct SElement { int Key; SElement *Next; } SOneElement;

2/20

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;
}
}

Hủy phần tử đầu của Stack

Hủy phần tử cuối của Stack

Hủy phần tử cuối của Stack và lấy giá trị đó in ra màn hình

Hủy toàn bộ Stack

Giải thích

Chọn đáp án D