The term "push" and "pop" is related to the
4 phương ánCó giải thích
Các phương án trả lời
Chọn một phương ánLời giảiChọn phương án để mở
Đáp án đúng: "stacks". Cặp thao tác push và pop chính là giao diện chuẩn của ngăn xếp: push đặt phần tử lên đỉnh, pop lấy phần tử ở đỉnh ra, cả hai chỉ làm việc tại một đầu duy nhất nên cấu trúc hoạt động theo nguyên tắc vào sau ra trước. "queues" dùng cặp thao tác khác là enqueue thêm vào cuối và dequeue lấy ra ở đầu, làm việc ở hai đầu đối diện để giữ nguyên tắc vào trước ra trước. "lists" là cấu trúc tổng quát hơn, giao diện của nó nói về chèn và xoá ở một vị trí hay chỉ số bất kỳ, không bị giới hạn ở một đầu. "array" chỉ là vùng nhớ liên tục truy cập bằng chỉ số; nó thường được dùng làm chỗ chứa bên trong để hiện thực một ngăn xếp, nhưng bản thân mảng không có thao tác nào mang tên push hay pop.
Cùng phần 2
Select the statement that is most correct.
Which of the following applications may not use a stack?Có lời giảiCâu hỏiConsider the following pseudocode:
declare a stack of characters
while(there are more characters in the word to read)
{read a character
if a character is '*' then
pop the stack
else
push the character into the stack
}
while(the stack is not empty)
pop and write the poped character to the screen
What is written to the screen for the input "Good**Morn**in***g" ?Có lời giảiCâu hỏiConsider the following pseudocode:
declare a stack of characters
while(there are more characters in the word to read)
{read a character
if a character is '*' then
pop and write the poped character to the screen
else
push the character into the stack
}
What is written to the screen for the input "Good**Morn**i***ng" ?Có lời giảiCâu hỏiCả 51 câu của chủ đề51 câu
Xuất hiện trong 1 bộ đề
Đi tiếp từ đây