Select the statement that is most correct. Which of the following applications may not 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: "Undo sequence in a text editor.". Chuỗi hoàn tác cần lấy ra đúng thao tác vừa làm gần nhất, tức vào sau ra trước, nên cấu trúc tự nhiên là ngăn xếp; nếu dùng hàng đợi thì lệnh hoàn tác đầu tiên lại gỡ thao tác cũ nhất, sai hẳn ngữ nghĩa. "Store a waiting list of printing jobs." là ứng dụng kinh điển của hàng đợi, bản in nào gửi trước thì in trước. "Multi-programming." cũng dùng hàng đợi, hệ điều hành xếp các tiến trình chờ bộ xử lý theo thứ tự đến để cấp lượt công bằng. "Auxiliary data structure for algorithms." đúng vì nhiều thuật toán lấy hàng đợi làm cấu trúc phụ, rõ nhất là duyệt theo bề rộng trên cây và đồ thị, nơi thứ tự vào ra quyết định việc thăm hết mức này mới sang mức sau.
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