Select the statement that is most correct. Which of the following applications may use a queue?
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: "Store a waiting list of printing jobs.". Hàng đợi phục vụ theo nguyên tắc vào trước ra trước, đúng như hàng chờ in: việc nào gửi tới máy in sớm hơn thì được in trước, việc mới luôn thêm vào cuối hàng và không ai chen ngang. Phương án "Store all variables in a program." cần tra theo tên ở bất kỳ thứ tự nào, đó là việc của bảng băm hay bảng ký hiệu, không phải cấu trúc chỉ cho lấy phần tử ở đầu. Phương án "Keeping track of local variables at run time." dùng ngăn xếp lời gọi: hàm gọi sau phải kết thúc trước, tức vào sau ra trước, trái hẳn hàng đợi. Phương án "Undo sequence in a text editor." cũng là ngăn xếp vì thao tác vừa làm phải được hoàn tác đầu tiên, còn hàng đợi sẽ hoàn tác thao tác cũ nhất trước.
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