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: "Multi-programming.". Đa chương trình phải xếp các tiến trình đang chờ theo đúng thứ tự tới để lần lượt cấp CPU hoặc thiết bị, tức cần một cấu trúc vào trước ra trước, chính là hàng đợi; đây là ví dụ kinh điển của hàng đợi trong hệ điều hành. Phương án "Undo sequence in a text editor." cần lấy ra thao tác vừa làm gần nhất, tức vào sau ra trước, nên đó là việc của ngăn xếp. Phương án "Keeping track of local variables at run time." cũng là ngăn xếp: khung hoạt động của lời gọi nào mở sau thì phải đóng trước, nên biến cục bộ sống và chết theo kỷ luật đó. Phương án "Store all variables in a program." không phải việc của hàng đợi mà của bảng ký hiệu hay bảng băm, vì ở đó ta cần tra theo tên trong thời gian gần như hằng số, chứ không cần thứ tự vào ra.
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